2

I have kde desktop environment, and Fn + F3 / F4 buttons cannot change keyboard brightness.

I also assign other keys to increase or decrease keyboard brightness in global shortcuts menu, but its not work again.


So I try to change brightness level by this command:

echo 3 | sudo tee /sys/class/leds/asus::kbd_backlight/brightness

And keyboard brightness change successfully.

But kde uses dbus to change keyboard brightness, So I try to use this command (which can be found in Arch wiki):

dbus-send --type=method_call --print-reply=literal --system --dest='org.freedesktop.UPower' '/org/freedesktop/UPower/KbdBacklight' 'org.freedesktop.UPower.KbdBacklight.SetBrightness' int32:2

But brightness not changes at all and I got this error:

Error org.freedesktop.DBus.Error.UnknownMethod: No such interface “org.freedesktop.UPower.KbdBacklight” on object at path /org/freedesktop/UPower/KbdBacklight

So I try change permission of that file:

sudo chmod 666 /sys/class/leds/asus::kbd_backlight/brightness

‌But I can't change keyboard brightness by Fn + F3 / F4 or dbus again.


Additional information:

Fn + F3 or F4 keys combinations works well and I can see signal sends well:

$ xev | sed -n 's/^.*state \([0-9].*\), keycode *\([0-9]\+\) *\(.*\), .*$/keycode \2 = \3, state = \1/p'
keycode 237 = (keysym 0x1008ff06, XF86KbdBrightnessDown), state = 0x10
keycode 237 = (keysym 0x1008ff06, XF86KbdBrightnessDown), state = 0x10
keycode 238 = (keysym 0x1008ff05, XF86KbdBrightnessUp), state = 0x10
keycode 238 = (keysym 0x1008ff05, XF86KbdBrightnessUp), state = 0x10

So how can I change keyboard brightness with dbus?

  • What is the version of yours upower ? – Ali Razmdideh Sep 15 '18 at 22:45
  • @AliRazmdideh 0.99.8-2 – Tara S Volpe Sep 15 '18 at 22:46
  • What the output of this comand : journalctl | grep -i upowerd – Ali Razmdideh Sep 15 '18 at 23:14
  • @AliRazmdideh upowerd[2907]: up_kbd_backlight_brightness_read: assertion 'fd >= 0' failed – Tara S Volpe Sep 15 '18 at 23:18
1
+50

As you said you are using 0.99.8-2 version of upower package.

In the last update of upower many distribution users, like Debian unstable, Arch linux, Ubuntu cosmic, have encountered this problem.

For example this issue is related yours, has opened in upower GitLab page.

According to that link, this method should be solve your problem (which has solved my problem on debian sid):

1.Make override configuration for upower service:

sudo systemctl edit upower.service

2.Write these lines in it:

[Service]
ProtectKernelTunables=false

3.Check the changes by this command:

systemctl show upower.service | grep ProtectKernelTunables

If you see this output, you did it right:

ProtectKernelTunables=no

For more details about ProtectKernelTunables= parameter, you can see this link.

4.Reboot your system (also you can restart upower and dbus services but its better reboot system to restart all services completely).

5.Check your keyboard backlight. Now you should not see somethigs like this, in the output of journalctl | grep -i upowerd command:

upowerd[2907]: up_kbd_backlight_brightness_read: assertion 'fd >= 0' failed

And your keyboard backlight should be change with Fn + F3 and Fn + F4 key combinations or dbus command:

dbus-send --type=method_call --print-reply=literal --system --dest='org.freedesktop.UPower' '/org/freedesktop/UPower/KbdBacklight' 'org.freedesktop.UPower.KbdBacklight.SetBrightness' int32:3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.