You are not logged in.

#1 2022-05-28 15:28:22

MarkGotLasagna
Member
From: Italy
Registered: 2022-01-27
Posts: 19
Website

Can't change screen brightness by scrolling after boot [SOLVED]

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/brightness

With 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/brightness

indeed 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/brightness

and 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

#2 2022-05-28 15:37:35

dogknowsnx
Guest

Re: Can't change screen brightness by scrolling after boot [SOLVED]

Did you add your user to the video group?

#3 2022-05-28 15:39:57

MarkGotLasagna
Member
From: Italy
Registered: 2022-01-27
Posts: 19
Website

Re: Can't change screen brightness by scrolling after boot [SOLVED]

Yes, I guess I did so.

maruko@markarch ~ id
uid=1000(maruko) gid=1000(maruko) groups=1000(maruko),985(video),998(wheel)

maruko

Offline

#4 2022-05-28 16:03:30

dogknowsnx
Guest

Re: Can't change screen brightness by scrolling after boot [SOLVED]

Please post the contents of the udev rule you created.

#5 2022-05-28 16:10:12

MarkGotLasagna
Member
From: Italy
Registered: 2022-01-27
Posts: 19
Website

Re: Can't change screen brightness by scrolling after boot [SOLVED]

───────┬──────────────────────────────────────────────────────────────────────────────────────
       │ 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

#6 2022-05-28 16:21:18

dogknowsnx
Guest

Re: Can't change screen brightness by scrolling after boot [SOLVED]

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)

#7 2022-05-28 16:35:06

MarkGotLasagna
Member
From: Italy
Registered: 2022-01-27
Posts: 19
Website

Re: Can't change screen brightness by scrolling after boot [SOLVED]

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

#8 2022-05-28 16:41:37

dogknowsnx
Guest

Re: Can't change screen brightness by scrolling after boot [SOLVED]

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)

#9 2022-05-28 17:12:05

MarkGotLasagna
Member
From: Italy
Registered: 2022-01-27
Posts: 19
Website

Re: Can't change screen brightness by scrolling after boot [SOLVED]

Yes, I edited out the line in the post.


maruko

Offline

Board footer

Powered by FluxBB