From aebdb5328af2fe2c825c0219f56dad61488a334d Mon Sep 17 00:00:00 2001 From: patrick96 Date: Sat, 21 Oct 2023 19:12:00 +0200 Subject: [PATCH] fix(backlight): Poll if necessary The `backlight` file seems to not receive modification events for inotify (it does receive other events though). These other events still trigger an update, but the value read is still the old value because the events arrive just slightly before the file is updated. The new `poll-interval` setting will inject an event every X seconds to force an update. If the actual_brightness file is used, the interval is set to 0 and thus turned off. This does not add any more wakeups to the module, the inotify modules wake up every second anyway and during that time, the interval is checked. Fixes #2835 --- CHANGELOG.md | 7 ++++-- include/modules/backlight.hpp | 19 ++++++++++++++-- src/modules/backlight.cpp | 42 +++++++++++++++++++++++++++++------ 3 files changed, 57 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a7dd4813..e4dad695 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,7 +32,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `internal/pulseaudio`: `reverse-scroll` option ([`#2664`](https://github.com/polybar/polybar/pull/2664)) - `custom/script`: Repeat interval for script failure (`interval-fail`) and `exec-if` (`interval-if`) ([`#943`](https://github.com/polybar/polybar/issues/943), [`#2606`](https://github.com/polybar/polybar/issues/2606), [`#2630`](https://github.com/polybar/polybar/pull/2630)) - `custom/text`: Loads the `format` setting, which supports the `