Rename battery_status to battery_state

This commit is contained in:
Dylan 2016-03-26 00:24:18 +11:00
parent 4bba141a9c
commit 1463b8f336

View file

@ -1555,7 +1555,7 @@ getbattery () {
esac esac
batteries=($(cat /sys/class/power_supply/BAT${battery_num}/capacity)) batteries=($(cat /sys/class/power_supply/BAT${battery_num}/capacity))
battery_status=($(cat /sys/class/power_supply/BAT${battery_num}/status)) battery_state=($(cat /sys/class/power_supply/BAT${battery_num}/status))
# Get the subtitle and reassign it so it doesn't change. # Get the subtitle and reassign it so it doesn't change.
title="$subtitle" title="$subtitle"
@ -1594,7 +1594,7 @@ getbattery () {
case "$distro" in case "$distro" in
"FreeBSD"*) "FreeBSD"*)
battery=$(acpiconf -i 0 | awk -F ':\t' '/Remaining capacity/ {print $2}') battery=$(acpiconf -i 0 | awk -F ':\t' '/Remaining capacity/ {print $2}')
battery_status=$(acpiconf -i 0 | awk -F ':\t\t\t' '/State/ {print $2}') battery_state=$(acpiconf -i 0 | awk -F ':\t\t\t' '/State/ {print $2}')
;; ;;
"NetBSD"*) "NetBSD"*)
@ -1616,7 +1616,7 @@ getbattery () {
"Mac OS X") "Mac OS X")
battery="$(pmset -g batt | grep -o '[0-9]*%')" battery="$(pmset -g batt | grep -o '[0-9]*%')"
battery_status="$(pmset -g batt | awk 'NR==2 {print $3}')" battery_state="$(pmset -g batt | awk 'NR==2 {print $3}')"
;; ;;
"Windows") "Windows")
@ -1628,7 +1628,7 @@ getbattery () {
;; ;;
esac esac
case "$battery_status" in case "$battery_state" in
*"charging"*) battery+=" Charging" ;; *"charging"*) battery+=" Charging" ;;
esac esac