]> git.draconx.ca Git - fvwmconf.git/commitdiff
scripts: remove hardcoded music directory from thumbnail.zsh.
authorNick Bowler <nbowler@ellipticsemi.com>
Fri, 30 May 2008 15:40:15 +0000 (11:40 -0400)
committerNick Bowler <nbowler@ellipticsemi.com>
Fri, 30 May 2008 15:40:15 +0000 (11:40 -0400)
Use a MUSIC environment variable and fall back to /home/music.  The fvwm
config sets this at startup.

config
finial/config
scripts/thumbnail.zsh

diff --git a/config b/config
index b256285d5d72a6acfd4dc537d61368a48454604d..23c9f31e9da18588386449de14545a46566cee7f 100644 (file)
--- a/config
+++ b/config
@@ -4,9 +4,13 @@ ImagePath $[FVWM_USERDIR]/icons:$[FVWM_USERDIR]/pixmaps
 DestroyFunc InitFunction
 DestroyFunc StartFunction
 DestroyFunc ExitFunction
+
+# Global environment
 SetEnv TERMINAL $[HOME]/bin/urxvt.sh
 PipeRead 'echo SetEnv HOST `hostname`'
 
+SetEnv MUSIC /home/music
+
 SetEnv XMODIFIERS '@im=uim'
 SetEnv GTK_IM_MODULE 'uim'
 SetEnv QT_IM_MODULE 'uim'
index b1b4221440250bef70b42f7c158e096519d673d8..75f9f7db885218d4119dc734e63d4041b10a1bac 100644 (file)
@@ -1,3 +1,6 @@
+# Global definitions
+SetEnv MUSIC /stuff/music
+
 # Import common features
 Read common/bindings
 Read common/nickstheme
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"