Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: Battery information #115

Closed
fluffeon opened this issue Jun 30, 2024 · 3 comments
Closed

[Feature]: Battery information #115

fluffeon opened this issue Jun 30, 2024 · 3 comments

Comments

@fluffeon
Copy link

fluffeon commented Jun 30, 2024

Is your feature request related to a problem? Please describe:

This is not really a problem nor is it really obligatory, this is just a suggestion.

Describe the solution you'd like:

Basically, a battery indicator under one of the rows on this fetch that shows battery percentage (Maybe also battery status? Like charging and etc). It should probably also account for other nuances like backup batteries, no batteries present (meaning this row would be hidden) or other batteries on the device.

Additional context:

N/A

@yuki-was-taken
Copy link
Contributor

yuki-was-taken commented Jul 2, 2024

I have an implementation of this stat https://github.com/yuki-was-taken/catnap/tree/battery but I'm not sure how handle multiple batteries. This implementation just reads from /sys/class/power_supply/BAT0, the folder for the default battery. Catnip's way of working limits me from putting a battery configuration option in config.toml (at least I think so). A way of handling multiple batteries is by reading from an environment variable.

EDIT: I've implemented the environment variable method for now.

2ND EDIT: I've changed it so that Catnap now performs a regex search to detect the default battery.

@fluffeon
Copy link
Author

fluffeon commented Jul 3, 2024

You are awesome.

@iinsertNameHere
Copy link
Owner

iinsertNameHere commented Jul 3, 2024

I also added that not only one BAT is checked but all existing ones. This will make it easier to add support for multiple batteries later.

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

No branches or pull requests

3 participants