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

Add Battery Stat #117

Merged
merged 5 commits into from
Jul 3, 2024
Merged

Conversation

yuki-was-taken
Copy link
Contributor

Is your pull request linked to an existing issue?

#115

What is your pull request about?:

Adds a battery stat. How it works is Catnap uses a regex search to find the default battery in /sys/class/power_supply/.

Any other disclosures/notices/things to add?

I'm still looking for a way to set the chosen battery in config.toml. Contributions appreciated.

Credits to https://gitlab.com/prashere/battinfo for the regex stuff.

This stat so far can only handle one battery (BAT0), so it is still
incomplete.
This makes the battery stat no longer hard-coded to BAT0. However, this
is clunky and is not preferred. The preferred method is setting it
inside of config.toml, but I'm not sure if that's possible to implement.
This commit removes Catnap choosing a battery via the CATNAP_BATTERY
environment variable. It now uses a regex search to determine the
default battery. Unfortunately, I'm still not able to set the chosen
battery via config.toml, so this will have to be sufficient.
@iinsertNameHere iinsertNameHere merged commit b6b3549 into iinsertNameHere:main Jul 3, 2024
1 check passed
@iinsertNameHere
Copy link
Owner

Thx! :)

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

Successfully merging this pull request may close these issues.

2 participants