Skip to content

Exposing 2 new methods under org.freedesktop.UPower.KbdBacklight: GetStopTimeout and SetStopTimeout

Federico requested to merge FedeDP/upower:kbd_stop_timeout into master

Some keyboard, eg my Dell XPS keyboard, expose a "stop_timeout" property that allows setting keyboard dimming period. For a project of mine (https://github.com/FedeDP/Clight) I'd really like to be able to set that property; I assumed that it could fit best in UPower.

Provided changes:

  • Added Getter and Setter methods in KbdBacklight dbus xml
  • Updated up-kbd-backlight.c to open a new fd (where available) to stop_timeout property
  • Added generic up_kbd_backlight_read and up_kbd_backlight_write functions that will just read/write a plain value from provided fd
  • Ported up_kbd_backlight_brightness_read and up_kbd_backlight_brightness_write to new API
  • Added 2 new functions: up_kbd_backlight_get_stop_timeout and up_kbd_backlight_set_stop_timeout that provide new API backend
  • Connected the new signal

Hopefully everything is right :) Thanks!

Merge request reports