add EWW_BATTERY
support in (free|open|net)bsd
#645
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This should add battery info support for 3/4 of the *BSDs supported as rust compile targets. I have only tested on FreeBSD, but based on the man pages of the others it should work there as well.
Usage
unchanged
Showcase
Additional Notes
I was not able to add support for dragonflyBSD, as it's version of the
apm
command is aliased toacpiconf -i 0
, which has different output and only lists the first battery. Thehtop
source code seems to implement this for dragonfly using something to the effect ofsysctl -n hw.acpi.battery.life
, but I could not find documentation for that sysctl variable anywhere, and don't have a dragonfly install to test on.Checklist
Please make sure you can check all the boxes that apply to this PR.
cargo fmt
to automatically format all code before committing