diff --git a/config/dwm/scripts/bar.sh b/config/dwm/scripts/bar.sh index ef2605c2..24536693 100755 --- a/config/dwm/scripts/bar.sh +++ b/config/dwm/scripts/bar.sh @@ -15,21 +15,16 @@ cpu() { printf "^c$white^ ^b$grey^ $cpu_val" } -lowbattery() { - get_capacity="$(cat /sys/class/power_supply/BAT1/capacity)" - if (( get_capacity <= 20)); then - printf "^c$red^ Low! $get_capacity" - else - printf "^c$blue^  $get_capacity" - fi -} - battery() { get_capacity="$(cat /sys/class/power_supply/BAT1/capacity)" get_status="$(cat /sys/class/power_supply/BAT1/status)" case "$get_status" in Charging) printf "^c$blue^ Charging $get_capacity" ;; - Discharging) lowbattery() ;; + Discharging) if (( $get_capacity <= 20)); then + printf "^c$red^ Low! $get_capacity" + else + printf "^c$blue^  $get_capacity" + fi ;; esac #printf "^c$blue^  $get_capacity" }