Browse Source

Fix streaming for cmus

umatrix-rules
Pearu Vaalma 3 years ago
parent
commit
9d8c04ca37
Signed by untrusted user who does not match committer: siinus
GPG Key ID: 259BA0611AE97CEF
  1. 13
      i3/.i3/blocks/mediaplayer

13
i3/.i3/blocks/mediaplayer

@ -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;
}
}

Loading…
Cancel
Save