fixed script
This commit is contained in:
parent
5b2b7a3662
commit
149bfbb723
|
@ -15,21 +15,16 @@ cpu() {
|
||||||
printf "^c$white^ ^b$grey^ $cpu_val"
|
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() {
|
battery() {
|
||||||
get_capacity="$(cat /sys/class/power_supply/BAT1/capacity)"
|
get_capacity="$(cat /sys/class/power_supply/BAT1/capacity)"
|
||||||
get_status="$(cat /sys/class/power_supply/BAT1/status)"
|
get_status="$(cat /sys/class/power_supply/BAT1/status)"
|
||||||
case "$get_status" in
|
case "$get_status" in
|
||||||
Charging) printf "^c$blue^ Charging $get_capacity" ;;
|
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
|
esac
|
||||||
#printf "^c$blue^ $get_capacity"
|
#printf "^c$blue^ $get_capacity"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue