summary refs log tree commit diff
path: root/.config
diff options
context:
space:
mode:
authorZach DeCook <zachdecook@librem.one>2023-10-17 21:06:17 -0400
committerZach DeCook <zachdecook@librem.one>2023-10-17 21:06:17 -0400
commit362311c20a78b0b1e391f44dffa7544ba126b1b4 (patch)
tree69e412a6d85642c965182b1c46ceae52d16310b7 /.config
parent31b4ef7794f862899df8966ca3c807cc3241a9ea (diff)
downloaddotfiles-362311c20a78b0b1e391f44dffa7544ba126b1b4.tar.gz
appstore: add launch command
Diffstat (limited to '.config')
-rwxr-xr-x.config/sxmo/userscripts/appstore.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/.config/sxmo/userscripts/appstore.sh b/.config/sxmo/userscripts/appstore.sh
index c66ca39..0743df4 100755
--- a/.config/sxmo/userscripts/appstore.sh
+++ b/.config/sxmo/userscripts/appstore.sh
@@ -28,11 +28,19 @@ exit"
 
 ## Functions
 
+bin2launch(){
+	xargs -I{} grep "^write_line_app {} " /usr/share/sxmo/default_hooks/*apps* |grep -o '"[^"]*"$' |xargs -I{} sh -c 'eval echo {}'
+}
+
 pkgInfo(){
 	pkg="$1"
 	case "$ID_LIKE" in
 		"alpine")
 			apk info -dws "$pkg" | grep -v '^$' | grep -v ' webpage:' | grep -v 'installed size:'
+			bins="$(apk info -L "$pkg" |grep ^usr/bin/ | cut -d/ -f3)"
+			if test -n "$bins"; then
+				echo "$bins" | bin2launch | sed 's/^/Launch /g'
+			fi
 			;;
 		"debian")
 			# apt has an unstable cli
@@ -169,6 +177,9 @@ exit"
 		"exit"|"")
 			exit
 			;;
+		"Launch "*)
+			${sel#???????}
+			;;
 		*"://"*)
 			sxmo_open.sh "$sel"
 			exit