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