From 42a9daec9db57e16541b6ef236b695b71bfb1199 Mon Sep 17 00:00:00 2001 From: yzy-1 <50034950+yzy-1@users.noreply.github.com> Date: Wed, 2 Oct 2024 08:22:50 +0800 Subject: Implement hide cursor on key press and on timeout --- niri-config/src/lib.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'niri-config/src/lib.rs') diff --git a/niri-config/src/lib.rs b/niri-config/src/lib.rs index cf55ecf1..bf08e1ba 100644 --- a/niri-config/src/lib.rs +++ b/niri-config/src/lib.rs @@ -615,6 +615,10 @@ pub struct Cursor { pub xcursor_theme: String, #[knuffel(child, unwrap(argument), default = 24)] pub xcursor_size: u8, + #[knuffel(child)] + pub hide_on_key_press: bool, + #[knuffel(child, unwrap(argument))] + pub hide_after_inactive_ms: Option, } impl Default for Cursor { @@ -622,6 +626,8 @@ impl Default for Cursor { Self { xcursor_theme: String::from("default"), xcursor_size: 24, + hide_on_key_press: false, + hide_after_inactive_ms: None, } } } @@ -2953,6 +2959,8 @@ mod tests { cursor { xcursor-theme "breeze_cursors" xcursor-size 16 + hide-on-key-press + hide-after-inactive-ms 3000 } screenshot-path "~/Screenshots/screenshot.png" @@ -3154,6 +3162,8 @@ mod tests { cursor: Cursor { xcursor_theme: String::from("breeze_cursors"), xcursor_size: 16, + hide_on_key_press: true, + hide_after_inactive_ms: Some(3000), }, screenshot_path: Some(String::from("~/Screenshots/screenshot.png")), hotkey_overlay: HotkeyOverlay { -- cgit