X-Git-Url: http://git.draconx.ca/gitweb/fvwmconf.git/blobdiff_plain/61a4f45722337bcd4ff40305963a9401b777f10d:/scripts/thumbnail.sh..f32812c246d791696b007798cb9e63fa3c695e9b:/scripts/thumbnail.zsh diff --git a/scripts/thumbnail.sh b/scripts/thumbnail.zsh similarity index 78% rename from scripts/thumbnail.sh rename to scripts/thumbnail.zsh index b04f2e6..245cba2 100755 --- a/scripts/thumbnail.sh +++ b/scripts/thumbnail.zsh @@ -1,6 +1,6 @@ -#!/bin/sh +#!/bin/zsh -music=/home/music +music=/stuff/music thumbs="$HOME/.fvwm/.thumbs" if [ ! -d "$thumbs" ]; then @@ -35,20 +35,20 @@ if ! expr match "$size" '^\([0-9]*\(x[0-9]\+\)\?\)$' >/dev/null 2>&1; then fi if [ -z "$1" ]; then - echo "usage: thumbnail.sh [--small|--size ] [--image] [--music] path" 1>&2 + echo "usage: thumbnail.zsh [--small|--size ] [--image] [--music] path" 1>&2 exit 1 fi if [ -n "$ismusic" ]; then - path="$music/`dirname "${1#$music}"`/cover.jpg" - [ ! -f "$path" ] && path="${path%jpg}png" + imgpath="$music/`dirname "${1#$music}"`/cover.jpg" + [ ! -f "$imgpath" ] && imgpath="${imgpath%jpg}png" else - path="$1" + imgpath="$1" fi -[ ! -f "$path" ] && exit 0 +[ ! -f "$imgpath" ] && exit 0 -image="`readlink -f -- "$path"`" +image="$(readlink -f -- "$imgpath")" [ ! -f "$image" ] && exit 0 thumb="$thumbs/`echo -n $image | md5sum - | cut -d ' ' -f 1`_$size.png"