From 0dfddcc62d215d92192d7abe24a6a254223e7910 Mon Sep 17 00:00:00 2001 From: Rose Date: Mon, 15 Sep 2025 13:19:37 +0200 Subject: desktop: make bar modular --- desktop/.local/bin/barstatus | 5 ++++- desktop/.local/share/barmodules/qmmp.sh | 12 ++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100755 desktop/.local/share/barmodules/qmmp.sh diff --git a/desktop/.local/bin/barstatus b/desktop/.local/bin/barstatus index 413e9d8..d0e92e6 100755 --- a/desktop/.local/bin/barstatus +++ b/desktop/.local/bin/barstatus @@ -1,5 +1,5 @@ #!/bin/sh -echo -n "SPKR: $(wpctl get-volume @DEFAULT_AUDIO_SINK@ 2> /dev/null ) ; MIC: $(wpctl get-volume @DEFAULT_AUDIO_SOURCE@ 2> /dev/null) " +echo -n "SPKR: $(wpctl get-volume @DEFAULT_AUDIO_SINK@ 2> /dev/null | sed 's/\.//g' )% ; MIC: $(wpctl get-volume @DEFAULT_AUDIO_SOURCE@ 2> /dev/null | sed 's/\.//g')%" echo -n " | " echo -n "$(date)" echo -n " | " @@ -18,3 +18,6 @@ if [ $? -eq 0 ]; then fi echo -n "$(qmmp --status | head -1)" fi +for f in ${HOME}/.local/share/barmodules/enabled/*; do + [ -x "$f" ] && [ ! -d "$f" ] && "$f" +done diff --git a/desktop/.local/share/barmodules/qmmp.sh b/desktop/.local/share/barmodules/qmmp.sh new file mode 100755 index 0000000..bb7f849 --- /dev/null +++ b/desktop/.local/share/barmodules/qmmp.sh @@ -0,0 +1,12 @@ +#!/bin/sh +pidof qmmp 2> /dev/null > /dev/null +if [ $? -eq 0 ]; then + echo -n " | " + nowplaying=$(qmmp --nowplaying '%p - %a: %t') + if [ ${#nowplaying} -gt 80 ]; then + echo -n "${nowplaying:0:77}... " + else + echo -n "$nowplaying" + fi + echo -n "$(qmmp --status | head -1)" +fi -- cgit v1.2.3