]> git.draconx.ca Git - mpdhacks.git/blobdiff - thumbnail.zsh
scripts: remove hardcoded music directory from thumbnail.zsh.
[mpdhacks.git] / thumbnail.zsh
index a96780392c65b2e83e45a269056570ce692cfe81..62294b60c9e0ae9eb4169c1a52cf2e1b69794cd5 100755 (executable)
@@ -1,6 +1,9 @@
 #!/bin/zsh
 
-music=/stuff/music
+if [[ -z "$MUSIC" ]]; then
+       MUSIC=/home/music
+fi
+
 thumbs="$HOME/.fvwm/.thumbs"
 
 if ! [[ -d "$thumbs" ]]; then
@@ -40,7 +43,7 @@ if [[ -z "$1" ]]; then
 fi
 
 if [[ -n "$ismusic" ]]; then
-       imgpath="$music/$(dirname "${1#$music}")/cover.jpg"
+       imgpath="$MUSIC/$(dirname "${1#$MUSIC}")/cover.jpg"
        [[ ! -f "$imgpath" ]] && imgpath="${imgpath%jpg}png"
 else
        imgpath="$1"