diff options
| -rwxr-xr-x | extras/HOME/.local/bin/library-view.sh | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/extras/HOME/.local/bin/library-view.sh b/extras/HOME/.local/bin/library-view.sh index 29925a8..b2c5dd5 100755 --- a/extras/HOME/.local/bin/library-view.sh +++ b/extras/HOME/.local/bin/library-view.sh @@ -13,10 +13,9 @@ fi cd ~/Library -files=(*.pdf) - -file_with_title="$(for file in "${files[@]}" ; do - echo "$file| $(echo "$file" | sed 's#\(^\|_\|\s\)\([a-z]\)#\1\U\2#g' | tr '_' ' ' | sed 's/.[^.]*$//')" +file_with_title="$(find . -name '*.pdf' | while read file ; do + echo "$file| $(echo "$file" | sed \ + 's#\(^\|_\|\s\)\([a-z]\)#\1\U\2#g;s/\.[^.]*$//;s#^\(.*\)/\([^/]*\)$#\2 (\1)#' | tr '_' ' ')" done)" selected=$(echo "$file_with_title" | (while read file ; do |