1
0
Fork 0
forked from wry/wry

add config options for waking dpms on mouse and keyboard interaction

This commit is contained in:
kossLAN 2026-05-25 22:57:29 -04:00
parent 2167484861
commit eece44a59c
No known key found for this signature in database
12 changed files with 116 additions and 9 deletions

View file

@ -1327,6 +1327,14 @@ impl ConfigClient {
self.send(&ClientMessage::SetIdle { timeout })
}
pub fn set_key_press_enables_dpms(&self, enabled: bool) {
self.send(&ClientMessage::SetKeyPressEnablesDpms { enabled })
}
pub fn set_mouse_move_enables_dpms(&self, enabled: bool) {
self.send(&ClientMessage::SetMouseMoveEnablesDpms { enabled })
}
pub fn set_idle_grace_period(&self, period: Duration) {
self.send(&ClientMessage::SetIdleGracePeriod { period })
}

View file

@ -475,6 +475,12 @@ pub enum ClientMessage<'a> {
SetIdle {
timeout: Duration,
},
SetKeyPressEnablesDpms {
enabled: bool,
},
SetMouseMoveEnablesDpms {
enabled: bool,
},
MoveToOutput {
workspace: WorkspaceSource,
connector: Connector,

View file

@ -252,6 +252,20 @@ pub fn set_idle(timeout: Option<Duration>) {
get!().set_idle(timeout.unwrap_or_default())
}
/// Configures whether a key press turns monitors back on after `jay dpms off`.
///
/// The default is `false`.
pub fn set_key_press_enables_dpms(enabled: bool) {
get!().set_key_press_enables_dpms(enabled)
}
/// Configures whether mouse movement turns monitors back on after `jay dpms off`.
///
/// The default is `false`.
pub fn set_mouse_move_enables_dpms(enabled: bool) {
get!().set_mouse_move_enables_dpms(enabled)
}
/// Configures the idle grace period.
///
/// The grace period starts after the idle timeout expires. During the grace period, the