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

feat(battery): added support for battery state-based classes on the entire waybar #2810

Merged
merged 9 commits into from
Jan 23, 2024

Conversation

ArneshRC
Copy link
Contributor

@ArneshRC ArneshRC commented Jan 7, 2024

The battery module now applies a single battery state-based class, .battery-<state> on the entire waybar.

This could be useful for, say, changing the bar's background color based on battery level.

config.jsonc:

"battery": {
    "states": {
        "warning": 30,
        "critical": 15
    },
}

style.css:

window#waybar.battery-warning {
  background-color: rgba(247, 218, 68, 0.2);
}

window#waybar.battery-critical {
  background-color: rgba(247, 68, 68, 0.2);
}

I'm sure there are quite a few users who would appreciate this feature: https://www.reddit.com/r/swaywm/comments/kuf9sm/make_waybar_turn_red_as_warning/

@Alexays
Copy link
Owner

Alexays commented Jan 18, 2024

LGTM, can you update the man and github wiki to show this new feature? :)

@ArneshRC
Copy link
Contributor Author

Done! :)

@ArneshRC
Copy link
Contributor Author

Made some small changes. As of d14a4a2, everything's working as expected.

@Alexays
Copy link
Owner

Alexays commented Jan 23, 2024

Thanks!

@Alexays Alexays merged commit 0948a40 into Alexays:master Jan 23, 2024
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