script color for low battery
This commit is contained in:
parent
9b7b36fe62
commit
9a2e0c9499
1 changed files with 10 additions and 1 deletions
|
@ -15,12 +15,21 @@ 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) printf "^c$blue^ $get_capacity" ;;
|
Discharging) $(lowbattery) ;;
|
||||||
esac
|
esac
|
||||||
#printf "^c$blue^ $get_capacity"
|
#printf "^c$blue^ $get_capacity"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue