mirror of
https://github.com/dylanaraps/neofetch.git
synced 2025-12-24 04:22:32 +00:00
Change to one-line if statement
This commit is contained in:
5
neofetch
5
neofetch
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user