refactor: nixify / clean remaining dots scripts
This commit is contained in:
1 parent
9030f33842
commit
9110789527
53 files changed
+265
-655
No files matched your search
Executable
+26
@@ -0,0 +1,26 @@
|
||||
# Generate menu of book filenames and save paths
|
||||
# Preview window contains metadata
|
||||
|
||||
function get_book_paths {
|
||||
find "$HOME/doc/books/" -regex '.*\.\(pdf\|epub\|djvu\)' -type f | sort
|
||||
}
|
||||
|
||||
function select_file {
|
||||
get_book_paths | fzf --delimiter=/ --with-nth=-1
|
||||
}
|
||||
|
||||
function open {
|
||||
if [ -n "$1" ]; then
|
||||
echo "Opening \"$1\""
|
||||
zathura "$1" --fork
|
||||
else
|
||||
echo "No file selected"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
case "${1:-}" in
|
||||
--open) open "$(select_file)" ;;
|
||||
--help) printf "open \n" >&2 ;;
|
||||
*) open "$(select_file)" ;;
|
||||
esac
|
||||
Reference in new issue
Block a user