(Scripts)~change music scripts to use playerctl instead

This commit is contained in:
2021-03-10 16:23:23 +00:00
parent 68498dd7c5
commit 8b6a9807f9
2 changed files with 7 additions and 13 deletions

View File

@@ -1,10 +1,3 @@
#!/usr/bin/env bash
name="$(mpc -f '%title%' | head -1)"
offline="$(echo $name | grep -E 'volume:|MPD')"
if [[ $offline ]]
then
name="MPD off"
else
name="$name"
fi
echo  $name
echo  "$(playerctl --player=spotify metadata title)"

View File

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