From f3ca16097f4d1f6b817a5dca11b199ca1e10beff Mon Sep 17 00:00:00 2001 From: Soispha Date: Sun, 31 Dec 2023 17:28:02 +0100 Subject: feat(hm/conf/yambar): Show currently playing song in bar --- hm/soispha/conf/yambar/scripts/mpd_song_name | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 hm/soispha/conf/yambar/scripts/mpd_song_name (limited to 'hm/soispha/conf/yambar/scripts/mpd_song_name') diff --git a/hm/soispha/conf/yambar/scripts/mpd_song_name b/hm/soispha/conf/yambar/scripts/mpd_song_name new file mode 100755 index 00000000..d5f03335 --- /dev/null +++ b/hm/soispha/conf/yambar/scripts/mpd_song_name @@ -0,0 +1,22 @@ +#!/usr/bin/env dash + +# shellcheck source=/dev/null +SHELL_LIBRARY_VERSION="1.10.0" . %SHELL_LIBRARY_PATH + + +while true; do + state="$(mpc status '%state%')"; + + if [ "$state" = "playing" ]; then + song="$(mpc --format '[[%artist% - ]%title%]|[%file%]' current)"; + echo "playing|bool|true" + echo "song|string|$song" + else + echo "playing|bool|false" + fi + echo "" # commit + + sleep 2; +done + +# vim: ft=sh -- cgit 1.4.1