diff options
author | zachir <zachir@librem.one> | 2023-02-24 10:27:34 -0600 |
---|---|---|
committer | zachir <zachir@librem.one> | 2023-02-24 10:27:34 -0600 |
commit | 25af7059733a3f5fe0272d5fdb90f7e2faf54f2d (patch) | |
tree | 8b3eae9a166d93ff4eed47655a6917f0c664fd80 /dmenuunicode | |
parent | cb1ba09b2a36767afea74460947963542a04be53 (diff) |
add -w and -x flags for dmenu scripts (tofi vs dmenu)
Diffstat (limited to 'dmenuunicode')
-rwxr-xr-x | dmenuunicode | 15 |
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 |