Move argument parsing into script
[app-xmms2-notifier.git] / lib / App / XMMS2 / Notifier.pm
index b0a2f4458ee8a249b82599b5d3b6bab83dc21d52..f61a74aee26ddb10934cc2e0ddd329d27a691b3f 100644 (file)
@@ -7,22 +7,11 @@ our $VERSION = 0.001001;
 use Audio::XMMSClient 0.03;
 use Gtk2::Notify 0.05 -init,'xmms2-notifyd';
 
-use Getopt::Long;
-
 use constant CONVERSION_SPECIFIERS => qw/bitrate date sample_format url id channels samplerate tracknr genre artist album title/;
 
 ##################################################
 
-my $use_libnotify = 1;
-my $use_libpurple;
-my $format = '$artist - $title';
-
-GetOptions (
-       "libnotify!" => \$use_libnotify,
-       "libpurple!" => \$use_libpurple,
-       "format=s" => \$format,
-);
-
+my $format;
 my $xmms = Audio::XMMSClient->new('xmms2-notifyd');
 my $notify = Gtk2::Notify->new('');
 
@@ -43,8 +32,7 @@ sub notify{
        my $str=$format;
        $str =~ s/\$$_/$metadata{$_}/g for keys %metadata;
 
-       notify_libnotify $str if $use_libnotify;
-       # notify_libpurple $str if $use_libpurple;
+       notify_libnotify $str
 }
 
 sub on_playback_current_id {
@@ -58,6 +46,7 @@ sub on_playback_status {
 }
 
 sub run {
+       $format = $_[0];
        while (1) {
                last if ($xmms->connect);
                sleep 1
This page took 0.009683 seconds and 4 git commands to generate.