summaryrefslogtreecommitdiff
path: root/url.sh
diff options
context:
space:
mode:
Diffstat (limited to 'url.sh')
-rwxr-xr-xurl.sh18
1 files changed, 13 insertions, 5 deletions
diff --git a/url.sh b/url.sh
index 8a5e054..c9f189e 100755
--- a/url.sh
+++ b/url.sh
@@ -13,14 +13,22 @@ then
exit 1
fi
-# check dependency and warn user if necessary
-if ! command -v bemenu > /dev/null 2>&1
+# select a menu program or panic
+if command -v bemenu > /dev/null 2>&1
then
- echo 'You have to install bemenu.'
+ menu='bemenu'
+elif command -v dmenu > /dev/null 2>&1
+then
+ menu='dmenu'
+elif command -v sxmo_dmenu.sh > /dev/null 2>&1
+then
+ menu='sxmo_dmenu.sh'
+else
+ echo 'You have to install bemenu, sxmo_dmenu.sh or dmenu!'
exit 1
fi
-# check dependency and warn user if necessary
+# check firefox dependency and warn user if necessary
if ! command -v firefox > /dev/null 2>&1
then
echo 'You have to install firefox.'
@@ -29,7 +37,7 @@ fi
# let user select the URL
closer="close menu"
-line="$(sed "$ a ${closer}" < "${data_abs}" | bemenu -l 10)"
+line="$(sed "$ a ${closer}" < "${data_abs}" | ${menu} -l 10)"
selection="$(echo "${line}" | awk -F '\t' '{print $1}')"
# exit or open URL in browser