Files
home/.local/share/plasma/plasmoids/KdeControlStation/contents/ui/js/brightness.js
2025-10-08 10:35:48 +02:00

16 lines
500 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;
}