diff options
author | Rose Hellsing <rose@pinkro.se> | 2025-09-15 13:28:35 +0200 |
---|---|---|
committer | Rose Hellsing <rose@pinkro.se> | 2025-09-15 13:28:35 +0200 |
commit | 772dd5cd2751f8233231ec7441c4715b17766949 (patch) | |
tree | 4755ec7e669b26bd464f5223a2c94dcd7c10ef5c /desktop | |
parent | 0dfddcc62d215d92192d7abe24a6a254223e7910 (diff) | |
download | dotfiles-772dd5cd2751f8233231ec7441c4715b17766949.tar.gz dotfiles-772dd5cd2751f8233231ec7441c4715b17766949.tar.bz2 |
desktop: Add battery module
Diffstat (limited to 'desktop')
-rwxr-xr-x | desktop/.local/bin/barstatus | 19 | ||||
-rwxr-xr-x | desktop/.local/share/barmodules/battery.sh | 3 |
2 files changed, 5 insertions, 17 deletions
diff --git a/desktop/.local/bin/barstatus b/desktop/.local/bin/barstatus index d0e92e6..9a8d79f 100755 --- a/desktop/.local/bin/barstatus +++ b/desktop/.local/bin/barstatus @@ -2,22 +2,7 @@ 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 " | " -if [ $(hostname) == "sunflower" ]; then - echo -n "BATTERY: $(upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep 'percentage' | tr -d ' ' | sed 's/:/: /g'); " - echo -n "$(upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep 'state' | tr -d ' ' | sed 's/:/: /g')" -fi -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 for f in ${HOME}/.local/share/barmodules/enabled/*; do - [ -x "$f" ] && [ ! -d "$f" ] && "$f" + echo -n " | " + [ -x "$f" ] && [ ! -d "$f" ] && "$f" done diff --git a/desktop/.local/share/barmodules/battery.sh b/desktop/.local/share/barmodules/battery.sh new file mode 100755 index 0000000..9ff7330 --- /dev/null +++ b/desktop/.local/share/barmodules/battery.sh @@ -0,0 +1,3 @@ +#!/bin/sh +echo -n "BATTERY: $(upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep 'percentage' | tr -d ' ' | sed 's/:/: /g'); " +echo -n "$(upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep 'state' | tr -d ' ' | sed 's/:/: /g')" |