Skip to content

Commit

Permalink
Merge pull request #212 from FredDeschenes/battery-info-unavailable
Browse files Browse the repository at this point in the history
Don't display battery info if not available
  • Loading branch information
denysdovhan committed Jan 11, 2018
2 parents 2b26e79 + 7cfe264 commit e04b9cc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions spaceship.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -1086,6 +1086,8 @@ spaceship_battery() {
[[ -z $battery_data ]] && return
battery_percent="$( echo $battery_data | awk '{print $4}' )"
battery_status="$( echo $battery_data | awk '{print tolower($3)}' )"
else
return
fi

# Remove trailing % and symbols for comparison
Expand Down

0 comments on commit e04b9cc

Please sign in to comment.