From ffa4d4c8b9ee78536561036a986190db8a6b3f42 Mon Sep 17 00:00:00 2001 From: Ian Douglas Scott Date: Mon, 26 Jan 2026 17:48:39 -0800 Subject: [PATCH] WIP Set DPMS to off for new outputs while idle --- src/main.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main.rs b/src/main.rs index d8511c3..bfdb664 100644 --- a/src/main.rs +++ b/src/main.rs @@ -102,6 +102,7 @@ struct State { screensaver_inhibit: bool, system_actions: shortcuts::SystemActions, loop_handle: calloop::LoopHandle<'static, Self>, + is_idle: bool, } fn run_command(command: String) { @@ -132,6 +133,11 @@ impl State { self.inner .output_power_manager .get_output_power(&output, &self.inner.qh, ()); + + if self.is_idle { + // XXX fade? + output_power.set_mode(zwlr_output_power_v1::Mode::Off); + } self.outputs.push(Output { output, output_power, @@ -149,6 +155,7 @@ impl State { output.output_power.set_mode(zwlr_output_power_v1::Mode::On); } } + self.is_idle = is_idle; } // Fade surfaces on all outputs have finished fading out @@ -304,6 +311,7 @@ fn main() { screensaver_inhibit: false, system_actions, loop_handle: event_loop.handle(), + is_idle: false, }; globals.contents().with_list(|list| { for global in list {