commit da0b36b0ad175d789605aecd1f56bce02b57cc7b
parent 880e09c0f2b407d3e5238936a554984dde49c45a
Author: Dash Eclipse <dashezup@disroot.org>
Date: Mon, 21 Mar 2022 18:33:11 +0000
feat: add runx (shell script)
drop appimage
Diffstat:
2 files changed, 30 insertions(+), 15 deletions(-)
diff --git a/.local/bin/appimage b/.local/bin/appimage
@@ -1,15 +0,0 @@
-#!/bin/sh
-
-choose_appimage() {
- ls -d ${HOME}/Desktop/AppImage/*.AppImage \
- | bemenu \
- -i -l18 -p 'AppImage' -P '-->' \
- --tf '#26A69A' --tb '#212121' \
- --hf '#eeeeee' --hb '#005577'
-}
-
-APPIMAGE=$(choose_appimage)
-
-if [ ! -z "$APPIMAGE" ]; then
- exec "$APPIMAGE"
-fi
diff --git a/.local/bin/runx b/.local/bin/runx
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+run_bemenu() {
+ bemenu -i -H23 -P '-->' \
+ --tf '#26A69A' --tb '#212121' \
+ --hf '#eeeeee' --hb '#005577' \
+ $@
+}
+
+run_flatpak() {
+ APP=$(flatpak list --app --columns=name,description,version,application \
+ | tr '\t' ',' \
+ | column -s, -t \
+ | run_bemenu -l18 -p 'Flatpak' \
+ | awk '{print $NF}')
+ test ! -z "$app" && flatpak run "$APP"
+}
+
+run_appimage() {
+ APP=$(ls -d ${HOME}/Desktop/AppImage/*.AppImage | run_bemenu -l18 -p 'AppImage')
+ test ! -z "$app" && exec $APP
+}
+
+RUN=$(echo "Flatpak\nAppImage" | run_bemenu -l2 -p 'RUN')
+
+if [ "$RUN" = "Flatpak" ]; then
+ run_flatpak
+elif [ "$RUN" = "AppImage" ]; then
+ run_appimage
+fi