diff options
| author | Zach DeCook <zachdecook@librem.one> | 2023-10-17 21:06:17 -0400 |
|---|---|---|
| committer | Zach DeCook <zachdecook@librem.one> | 2023-10-17 21:06:17 -0400 |
| commit | 362311c20a78b0b1e391f44dffa7544ba126b1b4 (patch) | |
| tree | 69e412a6d85642c965182b1c46ceae52d16310b7 | |
| parent | 31b4ef7794f862899df8966ca3c807cc3241a9ea (diff) | |
| download | dotfiles-362311c20a78b0b1e391f44dffa7544ba126b1b4.tar.gz | |
appstore: add launch command
| -rwxr-xr-x | .config/sxmo/userscripts/appstore.sh | 11 |
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 |
