Replies: 2 comments 2 replies
-
I think I figured out why this happens by looking at the code. It could actually be considered a bug I think. In the int m_percentage = 0; By default “backlight” module reads brightness level from $ cat /sys/class/backlight/intel_backlight/actual_brightness
0 In m_max_brightness = m_max.read();
float val = m_val.read();
int percentage = math_util::percentage(val, m_max_brightness);
if (m_percentage != percentage) {
// ...
m_percentage = percentage;
if (m_label) {
m_label->reset_tokens();
m_label->replace_token("%percentage%", to_string(m_percentage));
}
// ...
} So from what I can tell it replaces the token only if the value changed since the last check. But at the beginning initial previous value ( So basically if initial brightness is 0 you have this bug. Since |
Beta Was this translation helpful? Give feedback.
-
Coming back to the original question. Both the battery and backlight module will refuse to start if there it can't find the configured backlight or battery. For the backlight, I'm not sure the situation you describe is distinguishable from the user simply turning their screen brightness all the way to 0. The backlight and all the backing files still exist, it just shows 0 for the brightness. |
Beta Was this translation helpful? Give feedback.
-
Is it possible to auto-hide some modules such as battery or backlight when there is either no battery or backlight on a device? For instance if I just turn off the builtin display on a laptop (in favor of external one(s)) instead of “backlight” level I get a string like
%percentage%%
on the bar. I would like to just hide the whole module if the data is not available.Beta Was this translation helpful? Give feedback.
All reactions