From 149bfbb7239eef880c1b943d172165c0b40056c4 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Fri, 4 Aug 2023 18:08:05 +0300 Subject: [PATCH] fixed script --- config/dwm/scripts/bar.sh | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) 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" }