Closed matchai closed 5 years ago
It appears this issue would also happen on spacefish, and the solution seems like a rather quick fix. 👍
🐟 spacefish-bot — Pull request copied from: https://github.com/denysdovhan/spaceship-prompt/pull/583.
When trying to show battery percentage with ACPI command having with multiple batteries causes bad math expression.
Fixes denysdovhan/spaceship-prompt#245
For the output of:
$ acpi -b Battery 0: Unknown, 97% Battery 1: Unknown, 98%
Original logic:
$ acpi -b 2>/dev/null | awk '{print $4}' | tr -d '%[,;]' 97 98
After piping acpi -b through head -1:
acpi -b
head -1
$ acpi -b 2>/dev/null | head -1 | awk '{print $4}' | tr -d '%[,;]' 97
:tada: This issue has been resolved in version 2.0.1 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:
It appears this issue would also happen on spacefish, and the solution seems like a rather quick fix. 👍
When trying to show battery percentage with ACPI command having with multiple batteries causes bad math expression.
Fixes denysdovhan/spaceship-prompt#245
For the output of:
Original logic:
After piping
acpi -b
throughhead -1
: