Change to one-line if statement

This commit is contained in:
Jorge Gonzalez 2016-12-12 17:57:49 -05:00 committed by GitHub
parent 6dbdaa4a63
commit da251b8bc9

View file

@ -1710,10 +1710,7 @@ get_battery() {
"Mac OS X")
battery="$(pmset -g batt | grep -o '[0-9]*%')"
state="$(pmset -g batt | awk '/;/ {print $4}')"
if [ "$state" == "charging;" ];
then
battery_state="charging"
fi
[[ "$state" == "charging;" ]] && battery_state="charging"
;;
"Windows")