Files
home/.local/share/plasma/plasmoids/KdeControlStation/contents/ui/js/brightness.js
2025-10-10 16:43:21 +02:00

16 lines
457 B
JavaScript

function updateBrightness(rootItem, source) {
if (rootItem.updateScreenBrightnessJob) return;
if (!source.data["PowerDevil"]) {
return;
}
// we don't want passive brightness change send setBrightness call
rootItem.disableBrightnessUpdate = true;
if (typeof source.data["PowerDevil"]["Screen Brightness"] === "number") {
rootItem.screenBrightness = source.data["PowerDevil"]["Screen Brightness"];
}
rootItem.disableBrightnessUpdate = false;
}