From 674039980ad5a7331dfd6b3d060204f377b89550 Mon Sep 17 00:00:00 2001 From: Xander Frangos <33106561+xanderfrangos@users.noreply.github.com> Date: Sat, 23 Nov 2024 17:57:59 -0500 Subject: [PATCH] Implement idleTransitionSpeed setting --- src/electron.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/electron.js b/src/electron.js index a668b5de..778b5b30 100644 --- a/src/electron.js +++ b/src/electron.js @@ -3925,11 +3925,19 @@ function idleCheckShort() { idleMonitorBlock?.release?.() idleMonitorBlock = blockBadDisplays("idle:start") try { + const transitionMonitors = {} Object.values(monitors)?.forEach((monitor) => { if(!shouldSkipDisplay(monitor, true)) { - updateBrightness(monitor.id, 0, true, "brightness") + if(settings.idleTransitionSpeed) { + transitionMonitors[monitor.id] = 0 + } else { + updateBrightness(monitor.id, 0, true, "brightness") + } } }) + if(Object.keys(transitionMonitors).length) { + transitionBrightness(0, transitionMonitors, settings.idleTransitionSpeed) + } } catch (e) { console.log(`Error dimming displays`, e) }