daemon that reads keystrokes from /dev/input/event* and acts on the "multimedia keys"
[soepkiptng.git] / k
blobc13abe4c9f268a5c96f8f315a413a1a5a82e9882
1 #!/usr/bin/perl
2 ############################################################################
3 # soepkiptng (c) copyright 2000 Eric Lammerts <eric@lammerts.org>.
4 # $Id$
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 ############################################################################
21 use Cwd 'abs_path';
22 use DBI;
23 use Getopt::Std;
24 use Socket;
26 # find program directory
27 $_ = $0;
28 while(-l) {
29 my $l = readlink or die "readlink $_: $!\n";
30 if($l =~ m|^/|) { $_ = $l; } else { s|[^/]*$|/$l|; }
32 m|(.*)/|;
33 my $progdir = abs_path($1);
35 require "$progdir/soepkiptng.lib";
37 getopts('c:');
38 read_configfile(\%conf, $opt_c);
40 $ENV{PATH} = "$progdir/bin:$ENV{PATH}";
42 chop(($song_id, undef, undef, undef, undef, undef, $type,
43 $user, $artist, $title, $album, $track, $len, $enc) = kill_song());
45 printf "next: %s - %02d. %s [%s]\n", $artist, $track, $title, $album;