From 25af7059733a3f5fe0272d5fdb90f7e2faf54f2d Mon Sep 17 00:00:00 2001 From: zachir Date: Fri, 24 Feb 2023 10:27:34 -0600 Subject: add -w and -x flags for dmenu scripts (tofi vs dmenu) --- dmenu_books | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'dmenu_books') 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 -- cgit v1.2.3