Move argument parsing into script
[app-xmms2-notifier.git] / xmms2-notifier
CommitLineData
f3286fcd 1#!/usr/bin/perl
d53a283b
MG
2use v5.14;
3use warnings;
4
5use App::XMMS2::Notifier;
f4385cf2 6use Getopt::Long;
d53a283b 7
f4385cf2
MG
8my $format = '$artist - $title';
9GetOptions ("format=s" => \$format);
10App::XMMS2::Notifier::run($format)
d53a283b
MG
11
12__END__
13
14=head1 NAME
15
16xmms2-notifier - script which notifies you what xmms2 is playing
17
18=head1 SYNOPSIS
19
20 # Shows libnotify notifications e.g. "Silence - Cellule"
21 xmms2-notifier
22
23 # Shows libnotify notifications e.g. "Cellule by Silence (L'autre endroit), year 2005, genre Electro"
24 xmms2-notifier --format="$title by $artist ($album), year $date, genre $genre"
25
26=head1 DESCRIPTION
27
28xmms2-notifier is a script which shows libnotify notifications when
29the song is changed and when the playback is started/resumed.
30
31You can control the notification format with the B<--format> argument.
32The following strings are replaced:
33
34=over
35
36=item $bitrate
37
38The song bitrate, in bits/s. Example: 785104
39
40=item $date
41
42Usually the year the song was published. Example: 2005
43
44=item $sample_format
45
46The format of each sample. Example: S16
47
48=item $url
49
50An URL that points to the song. Example: file:///ext/Music/Silence+-+Cellule.flac
51
52=item $id
53
54The XMMS2 id of the song. Example: 498
55
56=item $channels
57
58The number of channels the song has. Example: 2
59
60=item $samplerate
61
62The sample rate of the song, in Hz. Example: 44100
63
64=item $tracknr
65
66The track number in the album. Example: 1
67
68=item $genre
69
70The genre of the song. Example: Electro
71
72=item $artist
73
74The artist/band. Example: Silence
75
76=item $album
77
78The album the song is from. Example: L'autre endroit
79
80=item $title
81
82The song title. Example: Cellule
83
84=back
85
86=head1 SEE ALSO
87
88L<xmms2(1)>
89
90=head1 AUTHOR
91
92Marius Gavrilescu, E<lt>marius@ieval.roE<gt>
93
94=head1 COPYRIGHT AND LICENSE
95
96Copyright (C) 2013 by Marius Gavrilescu
97
98This library is free software; you can redistribute it and/or modify
99it under the same terms as Perl itself, either Perl version 5.14.2 or,
100at your option, any later version of Perl 5 you may have available.
101
102
103=cut
104
This page took 0.015824 seconds and 4 git commands to generate.