From fa6f5f1c2997f0b6e69c435285d19b5b2ec173ff Mon Sep 17 00:00:00 2001 From: Nick Bowler Date: Wed, 28 May 2008 15:17:51 -0400 Subject: [PATCH] thumbnail.sh should be thumbnail.zsh. --- mpdmenu.pl | 12 ++++++------ thumbnail.sh => thumbnail.zsh | 16 ++++++++-------- 2 files changed, 14 insertions(+), 14 deletions(-) rename thumbnail.sh => thumbnail.zsh (78%) diff --git a/mpdmenu.pl b/mpdmenu.pl index 7a48c20..94ec8d5 100755 --- a/mpdmenu.pl +++ b/mpdmenu.pl @@ -138,11 +138,11 @@ if (defined $album) { my $key = $_; my $a_album = sanitise($key); - open THUMB, "-|", "$FVWM/scripts/thumbnail.sh", + open THUMB, "-|", "$FVWM/scripts/thumbnail.zsh", "--small", "--music", $albums{$key}; my $thumb = ; close THUMB; - die("Incompetent use of thumbnail.sh") if ($?); + die("Incompetent use of thumbnail.zsh") if ($?); $thumb =~ s/\n//sg; $thumb = "%$thumb%" if (-f $thumb); @@ -234,11 +234,11 @@ if (defined $album) { $t_artist = sanitise($t_artist); $t_title = sanitise($t_title); - open THUMB, "-|", "$FVWM/scripts/thumbnail.sh", + open THUMB, "-|", "$FVWM/scripts/thumbnail.zsh", "--small", "--music", $t_file; my $thumb = ; close(THUMB); - die("Incompetent use of thumbnail.sh") if ($?); + die("Incompetent use of thumbnail.zsh") if ($?); $thumb =~ s/\n//sg; $thumb = "%$thumb%" if (-f $thumb); @@ -276,12 +276,12 @@ if (defined $album) { } die("Failed data query\n") unless (keys(%entry) > 0); - open THUMB, "-|", "$FVWM/scripts/thumbnail.sh", + open THUMB, "-|", "$FVWM/scripts/thumbnail.zsh", "--image", "--music", $entry{file}; my $thumb = ; my $scan = ; close(THUMB); - die("Incompetent use of thumbnail.sh") if ($?); + die("Incompetent use of thumbnail.zsh") if ($?); $thumb =~ s/\n//sg; $scan =~ s/\n//sg; diff --git a/thumbnail.sh b/thumbnail.zsh similarity index 78% rename from thumbnail.sh rename to thumbnail.zsh index b04f2e6..245cba2 100755 --- a/thumbnail.sh +++ b/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" -- 2.43.0