Skip to content
This repository has been archived by the owner on Feb 3, 2021. It is now read-only.

Battery section: ACPI use only first battery value #124

Closed
matchai opened this issue Dec 19, 2018 · 1 comment Β· Fixed by #126
Closed

Battery section: ACPI use only first battery value #124

matchai opened this issue Dec 19, 2018 · 1 comment Β· Fixed by #126

Comments

@matchai
Copy link
Owner

matchai commented Dec 19, 2018

It appears this issue would also happen on spacefish, and the solution seems like a rather quick fix. πŸ‘

🐟 spacefish-bot β€” Pull request copied from: spaceship-prompt/spaceship-prompt#583.

When trying to show battery percentage with ACPI command having with multiple batteries causes bad math expression.

Fixes spaceship-prompt/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 2>/dev/null | head -1 | awk '{print $4}' | tr -d '%[,;]'
97
@spacefish-bot spacefish-bot bot changed the title #583 Battery section: ACPI use only first battery value Dec 19, 2018
matchai added a commit that referenced this issue Dec 28, 2018
@matchai matchai self-assigned this Dec 30, 2018
@matchai matchai removed the Good First Issue Good for newcomers label Jan 2, 2019
matchai added a commit that referenced this issue Jan 9, 2019
@matchai
Copy link
Owner Author

matchai commented Jan 9, 2019

πŸŽ‰ This issue has been resolved in version 2.0.1 πŸŽ‰

The release is available on GitHub release

Your semantic-release bot πŸ“¦πŸš€

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant