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