Skip to content

Conversation

@patrick96
Copy link
Member

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update
  • Other: Replace this with a description of the type of this PR

Description

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.

Related Issues & Documents

Fixes #2835

Documentation (check all applicable)

  • This PR requires changes to the Wiki documentation (describe the changes)
  • This PR requires changes to the documentation inside the git repo (please add them to the PR).
  • Does not require documentation changes

Document poll-interval and maybe better describe the recommended settings.

@codecov
Copy link

codecov bot commented Oct 21, 2023

Codecov Report

Merging #3028 (7472356) into master (278584f) will decrease coverage by 0.02%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master    #3028      +/-   ##
==========================================
- Coverage   12.71%   12.69%   -0.02%     
==========================================
  Files         160      160              
  Lines       12517    12530      +13     
==========================================
  Hits         1591     1591              
- Misses      10926    10939      +13     
Flag Coverage Δ
unittests 12.69% <0.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
include/modules/backlight.hpp 0.00% <ø> (ø)
src/modules/backlight.cpp 0.00% <0.00%> (ø)

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 polybar#2835
@patrick96 patrick96 added this to the 3.7.0 milestone Oct 21, 2023
@patrick96 patrick96 merged commit aebdb53 into polybar:master Oct 21, 2023
@patrick96 patrick96 deleted the inotify-poll branch October 21, 2023 18:32
@patrick96 patrick96 mentioned this pull request Nov 5, 2023
24 tasks
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.

[Bug]: Brightness not updated with amdgpu_bl

1 participant