statusbar add battery state

This commit is contained in:
nemo 2024-12-29 20:41:03 +01:00
parent 6403ac35bd
commit f4af33134f
1 changed files with 2 additions and 1 deletions

View File

@ -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