The backlight module requires /sys/class/backlight/*/brightness files to be owned and read/writable by the video group. That will only be the case if the sys-power/acpilight package (or alternatively the dev-libs/light while it still worked) is installed and installs the 90-backlight.rules udev rule. So polybar should either also package the 90-backlight.rules udev rule or depend on sys-power/acpilight, which is a bit unfortunate since that will mean having to install the xbacklight utility from that package, and cause a conflict with x11-apps/xbacklight. But without also installing that package (and rebooting), polybar's backlight module will currently not work. The more ideal solution in my opinion would be to package a udev rule that makes /sys/class/backlight/*/brightness 0664 root:video as a separate package, and make dev-libs/light, sys-power/acpilight, and x11-misc/polybar all depend from it. That way dev-libs/light+sys-power/acpilight, and x11-misc/polybar+x11-apps/xbacklight don't have to conflict with each other, and the backlight module can work without having to install sys-power/acpilight's xbacklight utility for no reason. o/ emanuele6
Created attachment 898970 [details] test.ini
Sorry, I've just noticed I didn't post reproduce steps: 1. create a test.ini file with the following content (attachment) [bar/test] modules-center = backlight [module/backlight] type = internal/backlight enable-scroll = true 2. run that test bar with polybar -c ./test.ini test 3. try to change the brightness of the screen using the scroll whell on the brightness percentage. If sys-power/acpilight is not installed (before the system is turned on), /usr/lib/udev/rules.d/90-backlight.rules will not be present and the backlight file used by polybar to set the brightness will only be readable and not writable by your larry:video user, so the backlight module will only be able to read the current brightness value, but not change it. o/ emanuele6
Thanks for the investigation! I'm not sure that this really warrants a separate package, but I also agree that we don't want a new dependency on a package providing this rule given the side effect (and because not everyone uses brightness from polybar). What about a "brightness" optfeature that indicates acpilight as enabling unprivileged brightness changes from the video group?
It is not clear why a separate package is not good idea since there are multiple packages that want that file, and light and acpilight are conflicting just because they both install that same file. An optfeature does not fix forcing the user to uninstall xbacklight to get this rule, but at least the user will now know they will need to install acpilight to make the backlight module work, so that is better than the current version where the user has to figure it out. o/ emanuele6
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2a33cda7f3b228048597d721970d163da5e7dbfa commit 2a33cda7f3b228048597d721970d163da5e7dbfa Author: John Helmert III <ajak@gentoo.org> AuthorDate: 2024-08-31 06:23:11 +0000 Commit: John Helmert III <ajak@gentoo.org> CommitDate: 2024-08-31 06:47:29 +0000 x11-misc/polybar: optfeature for backlight udev rule Closes: https://bugs.gentoo.org/937028 Signed-off-by: John Helmert III <ajak@gentoo.org> x11-misc/polybar/polybar-3.7.1-r1.ebuild | 6 +++++- x11-misc/polybar/polybar-3.7.2.ebuild | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-)