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 /dmenu_books | |
parent | cb1ba09b2a36767afea74460947963542a04be53 (diff) |
add -w and -x flags for dmenu scripts (tofi vs dmenu)
Diffstat (limited to 'dmenu_books')
-rwxr-xr-x | dmenu_books | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/dmenu_books b/dmenu_books index 367ee37..beb87cc 100755 --- a/dmenu_books +++ b/dmenu_books @@ -1,6 +1,17 @@ #!/bin/sh -BOOK=`ls ~/Documents/shared | dmenu` +printhelp () { + exit +} + +while getopts "hwxd:" o; do case "${o}" in + w) DMENU="tofi" ;; + x) DMENU="dmenu" ;; + d) ARGS="$ARGS$OPTARG " ;; + *) printhelp ;; +esac done + +BOOK=`ls ~/Documents/shared | $DMENU $ARGS` [ -z "$BOOK" ] && exit 1 |