From 2f28ed91d9191eaf7d9fb50fa566e7aad232baea Mon Sep 17 00:00:00 2001 From: srdusr Date: Wed, 25 Oct 2023 13:44:12 +0200 Subject: Also track epub books --- track-books.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'track-books.sh') diff --git a/track-books.sh b/track-books.sh index 4a828e0..40c201c 100755 --- a/track-books.sh +++ b/track-books.sh @@ -4,10 +4,10 @@ books_directory="$HOME/documents/books" recent_books_file="$HOME/.config/nvim/tmp/recent_books.txt" inotifywait -m -e CREATE -e OPEN -r "$books_directory" | -while read -r path action file; do - if [[ $file == *.pdf ]]; then - echo "$path/$file" >>"$recent_books_file" - # Remove duplicates and overwrite the recent_books_file - sort -u -o "$recent_books_file" "$recent_books_file" - fi -done + while read -r path action file; do + if [[ $file == *.pdf || $file == *.epub ]]; then + echo "$path/$file" >>"$recent_books_file" + # Remove duplicates and overwrite the recent_books_file + sort -u -o "$recent_books_file" "$recent_books_file" + fi + done -- cgit v1.2.3