diff --git a/.bin/fzf-book b/.bin/fzf-book index 19791f1..61f61ab 100755 --- a/.bin/fzf-book +++ b/.bin/fzf-book @@ -3,8 +3,12 @@ # Generate menu of book filenames and save paths # Preview window contains metadata +function get_book_paths { + find /home/h/doc/books/ -regex '.*\.\(pdf\|epub\|djvu\)' -type f | sort +} + function select_file { - echo "$(find /home/h/doc/books/ -regex '.*\.\(pdf\|epub\|djvu\)' -type f | sort | fzf --delimiter=/ --with-nth=-1)" + get_book_paths | fzf --delimiter=/ --with-nth=-1 } function open {