diff options
| author | Josh Rahm <rahm@google.com> | 2022-01-13 14:28:47 -0700 |
|---|---|---|
| committer | Josh Rahm <rahm@google.com> | 2022-01-13 14:28:47 -0700 |
| commit | 6647209f708c09a2ab62ef3b5c77f9b4aa241c70 (patch) | |
| tree | 1bd685bf1af4efa0512c6e23555ae945620629d7 | |
| parent | 0bde08d5180d08ef102d3d5bff0f50f2e7533e4e (diff) | |
| download | rde-6647209f708c09a2ab62ef3b5c77f9b4aa241c70.tar.gz rde-6647209f708c09a2ab62ef3b5c77f9b4aa241c70.tar.bz2 rde-6647209f708c09a2ab62ef3b5c77f9b4aa241c70.zip | |
Support for subdirectories in Library
| -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 |