|
|
|
@ -52,10 +52,14 @@ sub buttons {
@@ -52,10 +52,14 @@ sub buttons {
|
|
|
|
|
} |
|
|
|
|
} elsif ($method eq 'cmus') { |
|
|
|
|
if ($ENV{'BLOCK_BUTTON'} == 1) { |
|
|
|
|
system("cmus-remote --prev"); |
|
|
|
|
system("cmus-remote --pause"); |
|
|
|
|
} elsif ($ENV{'BLOCK_BUTTON'} == 2) { |
|
|
|
|
system("cmus-remote --pause"); |
|
|
|
|
} elsif ($ENV{'BLOCK_BUTTON'} == 3) { |
|
|
|
|
system("cmus-remote --stop"); |
|
|
|
|
} elsif ($ENV{'BLOCK_BUTTON'} == 4) { |
|
|
|
|
system("cmus-remote --prev"); |
|
|
|
|
} elsif ($ENV{'BLOCK_BUTTON'} == 5) { |
|
|
|
|
system("cmus-remote --next"); |
|
|
|
|
} |
|
|
|
|
} elsif ($method eq 'playerctl') { |
|
|
|
@ -95,6 +99,12 @@ sub cmus {
@@ -95,6 +99,12 @@ sub cmus {
|
|
|
|
|
@metadata[0] = $value if $key eq 'artist'; |
|
|
|
|
@metadata[1] = $value if $key eq 'title'; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
my @streamData = split /\s/, $line; |
|
|
|
|
if (shift @streamData eq 'stream') { |
|
|
|
|
my $value = join ' ', @streamData; |
|
|
|
|
@metadata[0] = join ' ', $value; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (@metadata) { |
|
|
|
@ -102,6 +112,7 @@ sub cmus {
@@ -102,6 +112,7 @@ sub cmus {
|
|
|
|
|
|
|
|
|
|
# metadata found so we are done |
|
|
|
|
print(join ' - ', @metadata); |
|
|
|
|
print("\n"); |
|
|
|
|
exit 0; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|