summaryrefslogtreecommitdiff
path: root/dmenu_books
blob: 645ece870f62ed6b3400cbbc093d57d9099e2b06 (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=${ARG:+"$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"