You are not logged in.
Hi, my name's Mark and I have a problem with the screen brightness,
namely the feature to change the brightness using the scroll wheel inside polybar.
The problem
https://imgur.com/a/R2ZpEL0
In the above image you can see on the right a "Sun" icon with the brightness value pulled from
/sys/class/backlight/amdgpu_bl0/brightnessWith this displayed value I should be able to interact with the scroll wheel and change the brightness of my laptop (Lenovo IdeaPad S340).
The GitHub page for polybar for the module backlight, states that a change in group ownership & user group might be needed for the scroll wheel to work, which is indeed my case (https://github.com/polybar/polybar/wiki … -backlight). Proper permissions are needed to change the value inside the file.
If I run the following commands:
sudo chown maruko /sys/class/backlight/amdgpu_bl0/brightness
sudo chgrp video /sys/class/backlight/amdgpu_bl0/brightnessindeed the brightness changes with the scroll wheel, but if I reboot/poweroff the system, permissions revert back to
-rw-r--r-- 1 root root 4096 May 28 16:52 /sys/class/backlight/amdgpu_bl0/brightnessand I can't change the brightness anymore.
Before posting here, I looked at the Backlight wiki page, added a udev rule but no luck.
Why are you posting this here?
I believe this is MY PROBLEM not understanding how permissions and files are managed and not a polybar issue.
Can I have your help?
Last edited by MarkGotLasagna (2022-05-28 16:37:15)
maruko
Offline
Did you add your user to the video group?
Yes, I guess I did so.
maruko@markarch ~ id
uid=1000(maruko) gid=1000(maruko) groups=1000(maruko),985(video),998(wheel)maruko
Offline
Please post the contents of the udev rule you created.
───────┬──────────────────────────────────────────────────────────────────────────────────────
│ File: /etc/udev/rules.d/backlight.rules
│ Size: 139 B
───────┼──────────────────────────────────────────────────────────────────────────────────────
1 │ # this should fix change in brightness for polybar
2 │ ACTION=="add", SUBSYSTEM=="backlight", KERNEL=="amdgpu_bl0", GROUP="video", MODE="0664"
───────┴──────────────────────────────────────────────────────────────────────────────────────maruko
Offline
Maybe try the second approach from the backlight archwiki recommended for 'intel_backlight', adjusting it for/with "amdgpu_bl0"...
Last edited by dogknowsnx (2022-05-28 16:23:25)
After changing the above udev rule with the following content
───────┬──────────────────────────────────────────────────────────────────────────────────────
│ File: /etc/udev/rules.d/backlight.rules
│ Size: 339 B
───────┼──────────────────────────────────────────────────────────────────────────────────────
1 │ # this should fix change in brightness for polybar
2 │ # ACTION=="add", SUBSYSTEM=="backlight", KERNEL=="amdgpu_bl0", GROUP="video", MODE="0
│ 664"
3 │ RUN+="/bin/chgrp video /sys/class/backlight/amdgpu_bl0/brightness"
4 │ RUN+="/bin/chmod g+w /sys/class/backlight/amdgpu_bl0/brightness"
5 │ RUN+="/bin/chown 1000 /sys/class/backlight/amdgpu_bl0/brightness"
───────┴──────────────────────────────────────────────────────────────────────────────────────and adding the kernel parameter here below
/etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="acpi_backlight=video"I can now successfully change the brightness with my scroll wheel.
Thank you for your time.
Last edited by MarkGotLasagna (2022-05-28 17:09:58)
maruko
Offline
Great! Non c'è di che (you're welcome)
EDIT: Did you mean
GRUB_CMDLINE_LINUX_DEFAULT="acpi_backlight=video"?
Not sure whether "video" is a valid parameter and thus may create other issues...
Last edited by dogknowsnx (2022-05-28 16:56:03)
Yes, I edited out the line in the post.
maruko
Offline