diff options
author | dx <aryadevchavali1@gmail.com> | 2020-05-17 09:32:21 +0100 |
---|---|---|
committer | dx <aryadevchavali1@gmail.com> | 2020-05-17 09:32:21 +0100 |
commit | 53614cf7fec801578101789def84d5bf649b5e64 (patch) | |
tree | b4b1b51b6233fea5083dda4fae302048bf291754 | |
parent | 5cd84746d424c6d31749b9c1c0619a691b037422 (diff) | |
download | dotfiles-53614cf7fec801578101789def84d5bf649b5e64.tar.gz dotfiles-53614cf7fec801578101789def84d5bf649b5e64.tar.bz2 dotfiles-53614cf7fec801578101789def84d5bf649b5e64.zip |
+mpd support for bar
-rwxr-xr-x | Scripts/.local/scripts/set_bar | 13 |
1 files changed, 12 insertions, 1 deletions
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 |