summaryrefslogtreecommitdiff
path: root/dmenu_books
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 /dmenu_books
parentcb1ba09b2a36767afea74460947963542a04be53 (diff)
add -w and -x flags for dmenu scripts (tofi vs dmenu)
Diffstat (limited to 'dmenu_books')
-rwxr-xr-xdmenu_books13
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