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

Upower warning level #3028

Merged
merged 2 commits into from
Mar 22, 2024
Merged

Conversation

bartelsielski
Copy link
Contributor

Add CSS class based on the 'warning_level' field reported by UPower over D-Bus. This makes it possible to add custom styling when the battery is near empty.

Example:

#upower {
	background-color: #24283b;
	color: #9ece6a;
}

#upower.low {
	background-color: #f7768e;
	color: #24283b;
}

@keyframes blink {
	to {
		background-color: #24283b;
	}
}

#upower.critical {
	background-color: #f7768e;
	color: #24283b;

	animation-name: blink;
	animation-duration: 0.5s;
	animation-timing-function: steps(12);
	animation-iteration-count: infinite;
	animation-direction: alternate;
}

Additionally, fixed some potential uninitialized reads.

@Alexays
Copy link
Owner

Alexays commented Mar 18, 2024

Nice, thanks!

Add secondary CSS class based on the 'warning_level' field reported by UPower
over D-Bus.  This makes it possible to add custom styling when the battery is
near empty.
There are code paths in which some of these variables were used but not
initialized, causing undefined behavior.
@bartelsielski
Copy link
Contributor Author

Seems I had some typos in the initialization values, my apologies. I've updated them (and checked that it compiles this time). And fixed the issues clang-format reported.

@Alexays Alexays merged commit cc084f5 into Alexays:master Mar 22, 2024
7 of 9 checks passed
@bartelsielski bartelsielski deleted the upower-warning_level branch April 19, 2024 07:08
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