diff options
author | xengineering <me@xengineering.eu> | 2022-08-03 20:32:29 +0200 |
---|---|---|
committer | xengineering <me@xengineering.eu> | 2022-08-03 20:32:29 +0200 |
commit | 1ed5ec19de392a0b8791e24306b43e9772377ad6 (patch) | |
tree | f1ed7957dc291235b1199293f1ea9a951a8d6ee7 | |
parent | 46289c9ca45d23cbbb573515685a15fc17908bad (diff) | |
download | scripts-1ed5ec19de392a0b8791e24306b43e9772377ad6.tar scripts-1ed5ec19de392a0b8791e24306b43e9772377ad6.tar.zst scripts-1ed5ec19de392a0b8791e24306b43e9772377ad6.zip |
Make url.sh compatible with different menus
-rwxr-xr-x | url.sh | 18 |
1 files changed, 13 insertions, 5 deletions
@@ -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 |