summaryrefslogtreecommitdiff
path: root/dmenu_books
blob: a57947606699b500f6525d7fcf6f2d4fe8fccd32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh

printhelp () {
  exit
}

while getopts "hd:" o; do case "${o}" in
  d) ARG="$OPTARG" ;;
  *) printhelp ;;
esac done

BOOK=$(find ~/Documents/shared | dmenu -l 15 -p \"books\" ${ARG:+"$ARG"})

[ -z "$BOOK" ] && exit 1

zathura "$HOME/Documents/shared/$BOOK"