Files
dotfiles/.local/bin/dmenulib

17 lines
312 B
Plaintext
Raw Normal View History

2021-06-13 11:43:14 +01:00
#!/bin/sh
2021-06-13 11:43:14 +01:00
files="$(find -L "$HOME/Tower/Library" -name '*.pdf' -or -name '*.epub')"
2021-06-13 11:43:14 +01:00
options=$(echo "$files" | xargs --delimiter="\n" basename -a)
2021-06-13 11:43:14 +01:00
chosen=$(echo "$options" | dmenu -i -ix -c -l 30)
[ -z "$chosen" ] && exit
2021-06-13 11:43:14 +01:00
line="$(($chosen + 1))"
file="$(echo "$files" | sed "${line}q;d")"
zathura "$file"