From 8b6a9807f954bc373df5c11fdbdfe1792cacb5f4 Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Wed, 10 Mar 2021 16:23:23 +0000 Subject: (Scripts)~change music scripts to use playerctl instead --- Scripts/.local/scripts/status/music_update_bar | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'Scripts/.local/scripts/status/music_update_bar') diff --git a/Scripts/.local/scripts/status/music_update_bar b/Scripts/.local/scripts/status/music_update_bar index 7691f36..2bf6c54 100755 --- a/Scripts/.local/scripts/status/music_update_bar +++ b/Scripts/.local/scripts/status/music_update_bar @@ -2,11 +2,12 @@ while : do - while [[ $item != "player" && $item != "playlist" ]] + prev="$(playerctl --player=spotify metadata title)" + while [[ $item == $prev ]] do - sleep 0.01; - item=$(mpc idle | head -1); + sleep 1; + item="$(playerctl --player=spotify metadata title)"; done - kill -45 $(pidof dwmblocks); + kill -48 $(pidof dwmblocks); item=""; done -- cgit v1.2.3-13-gbd6f