Refactor 'fzf-book'

master
Hektor Misplon 2025-01-02 21:14:07 +01:00
parent 7e10a1c39d
commit d4ba22670a
1 changed files with 5 additions and 1 deletions

View File

@ -3,8 +3,12 @@
# Generate menu of book filenames and save paths # Generate menu of book filenames and save paths
# Preview window contains metadata # Preview window contains metadata
function get_book_paths {
find /home/h/doc/books/ -regex '.*\.\(pdf\|epub\|djvu\)' -type f | sort
}
function select_file { 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 { function open {