]> iEval git - app-xmms2-notifier.git/commitdiff
Reindent everything
authorMarius Gavrilescu <marius@ieval.ro>
Sat, 6 Feb 2016 18:01:34 +0000 (18:01 +0000)
committerMarius Gavrilescu <marius@ieval.ro>
Sat, 6 Feb 2016 18:01:34 +0000 (18:01 +0000)
lib/App/XMMS2/Notifier.pm
t/test.t

index 3e3183d933c74a74563a8133ee271241d730e27f..b0a2f4458ee8a249b82599b5d3b6bab83dc21d52 100644 (file)
@@ -18,9 +18,9 @@ my $use_libpurple;
 my $format = '$artist - $title';
 
 GetOptions (
-  "libnotify!" => \$use_libnotify,
-  "libpurple!" => \$use_libpurple,
-  "format=s" => \$format,
+       "libnotify!" => \$use_libnotify,
+       "libpurple!" => \$use_libpurple,
+       "format=s" => \$format,
 );
 
 my $xmms = Audio::XMMSClient->new('xmms2-notifyd');
@@ -31,41 +31,41 @@ $notify->set_timeout(3000);
 ##################################################
 
 sub notify_libnotify{
-  $notify->update($_[0]);
-  $notify->show;
+       $notify->update($_[0]);
+       $notify->show;
 }
 
 sub notify{
-  my $id=$xmms->playback_current_id->wait->value or return;
-  my $minfo=$xmms->medialib_get_info($id)->wait->value;
+       my $id=$xmms->playback_current_id->wait->value or return;
+       my $minfo=$xmms->medialib_get_info($id)->wait->value;
 
-  my %metadata = map { $_ => exists $minfo->{$_} ? (values $minfo->{$_})[0] : undef } CONVERSION_SPECIFIERS;
-  my $str=$format;
-  $str =~ s/\$$_/$metadata{$_}/g for keys %metadata;
+       my %metadata = map { $_ => exists $minfo->{$_} ? (values $minfo->{$_})[0] : undef } CONVERSION_SPECIFIERS;
+       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 if $use_libnotify;
+       # notify_libpurple $str if $use_libpurple;
 }
 
 sub on_playback_current_id {
-  notify;
-  $xmms->broadcast_playback_current_id->notifier_set(\&on_playback_current_id);
+       notify;
+       $xmms->broadcast_playback_current_id->notifier_set(\&on_playback_current_id);
 }
 
 sub on_playback_status {
-  notify if $xmms->playback_status->wait->value == 1; # 1 means playing, 2 means paused
-  $xmms->broadcast_playback_status->notifier_set(\&on_playback_status);
+       notify if $xmms->playback_status->wait->value == 1; # 1 means playing, 2 means paused
+       $xmms->broadcast_playback_status->notifier_set(\&on_playback_status);
 }
 
 sub run {
-  while(1){
-       last if ($xmms->connect);
-       sleep 1
-  }
-
-  $xmms->broadcast_playback_current_id->notifier_set(\&on_playback_current_id);
-  $xmms->broadcast_playback_status->notifier_set(\&on_playback_status);
-  $xmms->loop
+       while (1) {
+               last if ($xmms->connect);
+               sleep 1
+       }
+
+       $xmms->broadcast_playback_current_id->notifier_set(\&on_playback_current_id);
+       $xmms->broadcast_playback_status->notifier_set(\&on_playback_status);
+       $xmms->loop
 }
 
 1
index 1d2c8a5fd42c810a7b8b7a1a26cd46f3ff3d4e97..5f945bc75353e5b90883dd6962bfd7220f02f2fa 100644 (file)
--- a/t/test.t
+++ b/t/test.t
@@ -9,6 +9,6 @@ BEGIN { use_ok('App::XMMS2::Notifier') };
 can_ok('App::XMMS2::Notifier', qw/run notify_libnotify/);
 
 TODO: {
-  local $TODO = 'libpurple notify not written yet';
-  can_ok('App::XMMS2::Notifier', 'notify_libpurple');
+       local $TODO = 'libpurple notify not written yet';
+       can_ok('App::XMMS2::Notifier', 'notify_libpurple');
 }
This page took 0.039022 seconds and 4 git commands to generate.