waybar: only show playerctl status when playing
This commit is contained in:
parent
884a8df73c
commit
a846f50b42
|
@ -94,10 +94,19 @@ in
|
|||
on-scroll-up = "${mpc} vol +10";
|
||||
on-scroll-down = "${mpc} vol -10";
|
||||
};
|
||||
"custom/playerctl" = {
|
||||
"custom/playerctl" =
|
||||
let
|
||||
playerctl = "${pkgs.playerctl}/bin/playerctl --ignore-player=mpd";
|
||||
statusScript = pkgs.writeShellScript "waybar-playerctl-status" ''
|
||||
test "$(env LC_ALL=C ${playerctl} status title)" = "Playing" \
|
||||
&& ${playerctl} metadata title \
|
||||
|| echo ""
|
||||
'';
|
||||
in
|
||||
{
|
||||
format = "{}";
|
||||
exec = "${pkgs.playerctl}/bin/playerctl --ignore-player=mpd metadata title";
|
||||
on-click = "${pkgs.playerctl}/bin/playerctl --ignore-player=mpd play-pause";
|
||||
exec = "${statusScript}";
|
||||
on-click = "${playerctl} play-pause";
|
||||
interval = 1;
|
||||
tooltip = false;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue