From f4af33134fe0c53a03e456385f3180cbb975bcbd Mon Sep 17 00:00:00 2001 From: nemo Date: Sun, 29 Dec 2024 20:41:03 +0100 Subject: [PATCH] statusbar add battery state --- statusbar.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/statusbar.sh b/statusbar.sh index 6ad3801..6fa500f 100755 --- a/statusbar.sh +++ b/statusbar.sh @@ -5,11 +5,12 @@ status_bar(){ date=$(date +"%a %d %b. %Y") hour=$(date +"%H:%M") battery=$(upower -i $(upower -e | grep BAT) | grep percentage | sed "s/ //g" | cut -d ":" -f2) + battery_state=$(upower -i $(upower -e | grep BAT) | grep state | sed "s/ //g" | cut -d':' -f2) sound_card=$(cat ~/.config/sound_card) volume=$(amixer get $sound_card | grep % | head -n 1 | cut -f7 -d' ' | sed "s/\[\|\]//g") brightness=$(~/dev/script/luminosity get) - xsetroot -name "| res: $wifi | lum: $brightness | vol: $volume [$sound_card] | bat: $battery | $date | $hour |" + xsetroot -name "| res: $wifi | lum: $brightness | vol: $volume [$sound_card] | bat: $battery [$battery_state] | $date | $hour |" } if [[ $1 == "once" ]]; then