summaryrefslogtreecommitdiff
path: root/dmenuunicode
diff options
context:
space:
mode:
authorzachir <zachir@librem.one>2023-02-24 10:27:34 -0600
committerzachir <zachir@librem.one>2023-02-24 10:27:34 -0600
commit25af7059733a3f5fe0272d5fdb90f7e2faf54f2d (patch)
tree8b3eae9a166d93ff4eed47655a6917f0c664fd80 /dmenuunicode
parentcb1ba09b2a36767afea74460947963542a04be53 (diff)
add -w and -x flags for dmenu scripts (tofi vs dmenu)
Diffstat (limited to 'dmenuunicode')
-rwxr-xr-xdmenuunicode15
1 files changed, 13 insertions, 2 deletions
diff --git a/dmenuunicode b/dmenuunicode
index 704c809..d994614 100755
--- a/dmenuunicode
+++ b/dmenuunicode
@@ -2,8 +2,19 @@
# The famous "get a menu of emojis to copy" script.
-# Get user selection via dmenu from emoji file.
-chosen=$(cut -d ';' -f1 ~/.local/share/larbs/chars/* | dmenu -i -l 30 | sed "s/ .*//")
+printhelp () {
+ exit
+}
+
+while getopts "hwxd:" o; do case "${o}" in
+ w) DMENU="tofi" ;;
+ x) DMENU="dmenu" ;;
+ d) ARGS="$ARGS$OPTARG " ;;
+ *) printhelp ;;
+esac done
+
+# Get user selection via dmenu -i -l 30 from emoji file.
+chosen=$(cut -d ';' -f1 ~/.local/share/larbs/chars/* | $DMENU $ARGS | sed "s/ .*//")
# Exit if none chosen.
[ -z "$chosen" ] && exit