From f2c3f16a63c26961d33fa4260597392b87f921d7 Mon Sep 17 00:00:00 2001 From: Hektor Misplon Date: Fri, 2 Dec 2022 13:27:32 +0100 Subject: [PATCH] Handle 'non selections' --- .bin/fzf-book | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.bin/fzf-book b/.bin/fzf-book index be78542..60792d7 100755 --- a/.bin/fzf-book +++ b/.bin/fzf-book @@ -7,5 +7,7 @@ # 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)" selected="$(find /home/h/doc/books/ -regex '.*\.\(pdf\|epub\|djvu\)' -type f | sort | fzf --delimiter=/ --with-nth=-1)" -# Open and redirect output to /dev/null -zathura "$selected" --fork +echo "Opening \"$selected\"" + +# Open when a file is selected and redirect output to /dev/null +[[ -n "$selected" ]] && zathura "$selected" --fork &> /dev/null