diff options
Diffstat (limited to 'dmenu_books')
-rwxr-xr-x | dmenu_books | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/dmenu_books b/dmenu_books index 3b6f1fe..a579476 100755 --- a/dmenu_books +++ b/dmenu_books @@ -5,15 +5,12 @@ printhelp () { } while getopts "hd:" o; do case "${o}" in - d) ARGS="$ARGS$OPTARG " ;; + d) ARG="$OPTARG" ;; *) printhelp ;; esac done -DMENU="dmenu" -DEFARGS="-l 15 -p" - -BOOK=`ls ~/Documents/shared | $DMENU $DEFARGS \"books\" $ARGS` +BOOK=$(find ~/Documents/shared | dmenu -l 15 -p \"books\" ${ARG:+"$ARG"}) [ -z "$BOOK" ] && exit 1 -zathura "~/Documents/shared/$BOOK" +zathura "$HOME/Documents/shared/$BOOK" |