dotfiles/scripts/tmux/mpd

19 lines
319 B
Plaintext
Raw Normal View History

2021-12-13 00:36:00 +01:00
#!/usr/bin/env sh
2021-02-16 01:07:53 +01:00
isPlaying() {
if mpc status | grep playing >/dev/null
then
echo -e "▶"
else
echo -e "⏸"
fi
}
while true; do
PLAYING=$(isPlaying)
TITLE=$(mpc --format '[%artist% - ]%title%' | /usr/bin/head -n 1)
TIME=$(mpc | awk '(NR==2){print $3}')
echo -e "$PLAYING $TITLE | [$TIME]"
sleep 1
done