Files
home/.local/share/plasma/plasmoids/KdeControlStation/contents/ui/js/brightness.js

16 lines
457 B
JavaScript
Raw Normal View History

2025-10-08 10:35:48 +02:00
function updateBrightness(rootItem, source) {
2025-10-10 16:43:21 +02:00
if (rootItem.updateScreenBrightnessJob) return;
2025-10-08 10:35:48 +02:00
2025-10-10 16:43:21 +02:00
if (!source.data["PowerDevil"]) {
return;
}
2025-10-08 10:35:48 +02:00
2025-10-10 16:43:21 +02:00
// we don't want passive brightness change send setBrightness call
rootItem.disableBrightnessUpdate = true;
2025-10-08 10:35:48 +02:00
2025-10-10 16:43:21 +02:00
if (typeof source.data["PowerDevil"]["Screen Brightness"] === "number") {
rootItem.screenBrightness = source.data["PowerDevil"]["Screen Brightness"];
}
rootItem.disableBrightnessUpdate = false;
}