From: Nick Bowler Date: Fri, 30 May 2008 15:40:15 +0000 (-0400) Subject: scripts: remove hardcoded music directory from thumbnail.zsh. X-Git-Url: http://git.draconx.ca/gitweb/fvwmconf.git/commitdiff_plain/f6d26fa7bcdcbe82081219a9ed482e674085ab6b scripts: remove hardcoded music directory from thumbnail.zsh. Use a MUSIC environment variable and fall back to /home/music. The fvwm config sets this at startup. --- diff --git a/config b/config index b256285..23c9f31 100644 --- 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' diff --git a/finial/config b/finial/config index b1b4221..75f9f7d 100644 --- a/finial/config +++ b/finial/config @@ -1,3 +1,6 @@ +# Global definitions +SetEnv MUSIC /stuff/music + # Import common features Read common/bindings Read common/nickstheme diff --git a/scripts/thumbnail.zsh b/scripts/thumbnail.zsh index a967803..62294b6 100755 --- a/scripts/thumbnail.zsh +++ b/scripts/thumbnail.zsh @@ -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"