add backlight device #83

This commit is contained in:
piotr
2022-01-25 02:26:20 +01:00
parent aa96004484
commit 78e8cfe1af
4 changed files with 51 additions and 11 deletions

View File

@@ -1965,6 +1965,7 @@ class EditorWrapper(object):
},
"show-values": False,
"output-switcher": False,
"backlight-device": "",
"interval": 1,
"window-width": 0,
"window-margin": 0,
@@ -2013,6 +2014,9 @@ class EditorWrapper(object):
self.ctrl_comp_brightness = builder.get_object("ctrl-comp-brightness")
self.ctrl_comp_brightness.set_active("brightness" in settings["components"])
self.ctrl_backlight_device = builder.get_object("backlight-device")
self.ctrl_backlight_device.set_text(settings["backlight-device"])
self.ctrl_comp_volume = builder.get_object("ctrl-comp-volume")
self.ctrl_comp_volume.set_active("volume" in settings["components"])
@@ -2101,6 +2105,9 @@ class EditorWrapper(object):
if "brightness" in settings["components"]:
settings["components"].remove("brightness")
if self.ctrl_backlight_device.get_text():
settings["backlight-device"] = self.ctrl_backlight_device.get_text()
if self.ctrl_comp_volume.get_active():
if "volume" not in settings["components"]:
settings["components"].append("volume")