2 ############################################################################
3 # soepkiptng (c) copyright 2000 Eric Lammerts <eric@lammerts.org>.
5 ############################################################################
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License, version 2, as
8 # published by the Free Software Foundation.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # A copy of the GNU General Public License is available on the World Wide Web
16 # at `http://www.gnu.org/copyleft/gpl.html'. You can also obtain it by
17 # writing to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 # Boston, MA 02111-1307, USA.
19 ############################################################################
24 # find program directory
27 my $l = readlink or die "readlink $_: $!\n";
28 if($l =~ m
|^/|) { $_ = $l; } else { s|[^/]*$|/$l|; }
31 my $progdir = abs_path
($1);
33 require "$progdir/soepkiptng.lib";
37 read_configfile
(\
%conf, $opt_c);
45 my $newmtime = (stat $conf{statusfile
})[9];
47 if(!$pic || -e
$pic) {
48 if($newmtime == $mtime) {
54 open F
, $conf{statusfile
} or next;
57 my ($nowplaying, $filename);
58 chop($nowplaying = <F
>);
59 chop($filename = <F
>);
62 chop ((undef, undef, undef, undef,
63 $now_playing->{artist
},
64 $now_playing->{title
},
65 $now_playing->{album
},
66 $now_playing->{track
}) = <F
>);
69 $nowplaying > 0 or next;
72 $filename =~ s
|/*[^/]+$||;
73 $filename =~ s
|.*/|$progdir/pictures
/|;
76 foreach(qw
/gif jpg jpeg/) {
77 if(-e
"$filename.$_") {
78 $pic = "$filename.$_";
84 system qw
/xloadimage -onroot -fullscreen -border black/, $pic;
86 warn "$filename not found\n";
87 if($conf{picture_bg
}) {
88 system qw
/xloadimage -onroot -fullscreen -border black/,
91 system "xsetroot -solid black";