summaryrefslogtreecommitdiff
path: root/dmenuunicode
diff options
context:
space:
mode:
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