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 = <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);
$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 = <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);
}
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 = <THUMB>;
my $scan = <THUMB>;
close(THUMB);
- die("Incompetent use of thumbnail.sh") if ($?);
+ die("Incompetent use of thumbnail.zsh") if ($?);
$thumb =~ s/\n//sg;
$scan =~ s/\n//sg;
-#!/bin/sh
+#!/bin/zsh
-music=/home/music
+music=/stuff/music
thumbs="$HOME/.fvwm/.thumbs"
if [ ! -d "$thumbs" ]; then
fi
if [ -z "$1" ]; then
- echo "usage: thumbnail.sh [--small|--size <spec>] [--image] [--music] path" 1>&2
+ echo "usage: thumbnail.zsh [--small|--size <spec>] [--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"