From 53614cf7fec801578101789def84d5bf649b5e64 Mon Sep 17 00:00:00 2001 From: dx Date: Sun, 17 May 2020 09:32:21 +0100 Subject: +mpd support for bar --- Scripts/.local/scripts/set_bar | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'Scripts/.local') diff --git a/Scripts/.local/scripts/set_bar b/Scripts/.local/scripts/set_bar index c139115..d13ab3e 100755 --- a/Scripts/.local/scripts/set_bar +++ b/Scripts/.local/scripts/set_bar @@ -58,6 +58,17 @@ disk() { echo $(df | grep /dev/sda2 | awk '{print $5}') } +mpd() { + name=$(mpc -f '%title%' | head -1) + if [[ $name == "MPD error: Connection refused\n" ]] + then + name="MPD offline" + else + name="Playing: $name" + fi + echo $name +} + connections() { internet=$(nmcli g | sed -n 2p | awk '{print $1}') if [[ $internet == "connected" ]] @@ -69,6 +80,6 @@ connections() { } while true; do - xsetroot -name "Meme level at $(disk) $delimiter $(ram) $delimiter $(volume) $delimiter $(battery) $delimiter $(connections) $delimiter $(timedate)" + xsetroot -name "$(mpd) $delimiter Meme level at $(disk) $delimiter $(ram) $delimiter $(connections) $delimiter $(volume) $delimiter $(battery) $delimiter $(timedate)" sleep 30s; done -- cgit v1.2.3-13-gbd6f