summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRasmus Steinke <rasi@xssn.at>2014-11-01 11:05:27 +0100
committerRasmus Steinke <rasi@xssn.at>2014-11-01 11:05:27 +0100
commite604ed60ed75210e2879eed7289d059e1171cd0c (patch)
treecd65ab0a1b83ff6e76e015f86374308c65a42b1e
parent70a4661fc9de5a55e8c5db3917063b16324bfd58 (diff)
downloadperl-app-clerk-e604ed60ed75210e2879eed7289d059e1171cd0c.tar.gz
perl-app-clerk-e604ed60ed75210e2879eed7289d059e1171cd0c.tar.xz
only show relevant file types in local filesystem search
-rwxr-xr-xclerk8
1 files changed, 6 insertions, 2 deletions
diff --git a/clerk b/clerk
index 4f93f62..e91ef56 100755
--- a/clerk
+++ b/clerk
@@ -131,7 +131,9 @@ browseFilesystem () {
chose() {
if [[ -d "$selection" ]]; then
cd "$selection"
- selection="$(echo -e "0 Return to Library Menu\n---\n1 Add all music files\n---\n$(ls)" | dmenu_t -p "Chose Directory/Files > ")"
+ dirs="$(find . -maxdepth 1 \( ! -regex '.*/\..*' \) -type d | cut -c 3-)"
+ files="$(find -maxdepth 1 -type f -regex ".*/.*\.\(flac\|mp3\|ogg\|m4a\|wav\|wv\|mpc\|wma\|aac\)" | cut -c 3-)"
+ selection="$(echo -e "0 Return to Library Menu\n---\n1 Add all music files\n---\n..\n$(echo "$dirs")\n$(echo "$files")" | dmenu_t -p "$(realpath .) > ")"
chose
elif [[ "$selection" == "1 Add all music files" ]]; then
comboadd
@@ -144,7 +146,9 @@ browseFilesystem () {
}
cd ~
- selection="$(echo -e "0 Return to Library Menu\n---\n1 Add all music files\n---\n$(ls)" | dmenu_t -p "Chose Directory/Files > ")"
+ dirs="$(find . -maxdepth 1 \( ! -regex '.*/\..*' \) -type d | cut -c 3-)"
+ files="$(find -maxdepth 1 -type f -regex ".*/.*\.\(flac\|mp3\|ogg\|m4a\|wav\|wv\|mpc\|wma\|aac\)" | cut -c 3-)"
+ selection="$(echo -e "0 Return to Library Menu\n---\n1 Add all music files\n---\n..\n$(echo "$dirs")\n$(echo "$files")" | dmenu_t -p "$(realpath .) > ")"
chose
}