1
0
Fork 0
dotfiles/.local/bin/statusbar/sb-music

16 lines
455 B
Plaintext
Raw Normal View History

2022-07-04 21:36:33 +02:00
#!/bin/sh
2022-08-07 12:54:35 +02:00
filter() {
2023-02-07 17:19:53 +01:00
if mpc 1>/dev/null 2>&1 && [ "$(mpc | wc -l)" -eq 3 ]; then
song=$(mpc current -f "%artist% - %title%" | xargs -0)
[ ${#song} -gt 35 ] && song="$(printf %.35s "$song")…"
mpc | awk 'NR==2' | grep -q playing && icon="" || icon=""
echo "$icon $song"
elif mpc 1>/dev/null 2>&1 && [ "$(mpc | wc -l)" -eq 1 ]; then
echo "ﱙ"
else
exit 1
fi
2022-08-07 12:54:35 +02:00
}
2022-09-17 00:09:47 +02:00
pidof -x sbd-music >/dev/null 2>&1 || sbd-music >/dev/null 2>&1 &
2023-02-06 10:27:26 +01:00
filter