dots/.bin/fzf-book

11 lines
377 B
Plaintext
Raw Normal View History

2022-05-11 13:55:36 +02:00
#!/usr/bin/env bash
# Find and open pdf
2022-09-22 20:46:42 +02:00
# Generate menu of book filenames and save paths
# Preview window contains metadata
selected="$(find /home/h/doc/books/ -regex '.*\.\(pdf\|epub\|djvu\)' -type f | sort | fzf --delimiter=/ --with-nth=-1 --preview 'pdfinfo {}' --preview-window=right:70%:wrap)"
2022-05-11 13:55:36 +02:00
2022-09-22 20:42:04 +02:00
# Open and redirect output to /dev/null
zathura "$selected" 2> /dev/null &