From 71fef2ad2e873c45279cdd6e629218fb5dea1115 Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Mon, 8 Jan 2024 11:53:34 +0400 Subject: Add a few mouse libinput settings --- niri-config/src/lib.rs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'niri-config') diff --git a/niri-config/src/lib.rs b/niri-config/src/lib.rs index 2fe2b56d..35bda95e 100644 --- a/niri-config/src/lib.rs +++ b/niri-config/src/lib.rs @@ -48,6 +48,8 @@ pub struct Input { #[knuffel(child, default)] pub touchpad: Touchpad, #[knuffel(child, default)] + pub mouse: Mouse, + #[knuffel(child, default)] pub tablet: Tablet, #[knuffel(child)] pub disable_power_key_handling: bool, @@ -118,6 +120,16 @@ pub struct Touchpad { pub tap_button_map: Option, } +#[derive(knuffel::Decode, Debug, Default, PartialEq)] +pub struct Mouse { + #[knuffel(child)] + pub natural_scroll: bool, + #[knuffel(child, unwrap(argument), default)] + pub accel_speed: f64, + #[knuffel(child, unwrap(argument, str))] + pub accel_profile: Option, +} + #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum AccelProfile { Adaptive, @@ -679,6 +691,12 @@ mod tests { tap-button-map "left-middle-right" } + mouse { + natural-scroll + accel-speed 0.4 + accel-profile "flat" + } + tablet { map-to-output "eDP-1" } @@ -768,6 +786,11 @@ mod tests { accel_profile: Some(AccelProfile::Flat), tap_button_map: Some(TapButtonMap::LeftMiddleRight), }, + mouse: Mouse { + natural_scroll: true, + accel_speed: 0.4, + accel_profile: Some(AccelProfile::Flat), + }, tablet: Tablet { map_to_output: Some("eDP-1".to_owned()), }, -- cgit