forge
Explore
Log in

Don't you dare go Hollow

Add touchpad dwt setting

Browse files at this commit

e1971c4af5761d043e0fcef57b2cc9d8311fec00Ivan MolodetskikhParent: 07b1d0e
niri-config/src/lib.rsmodified+4 -0
@@ -107,6 +107,8 @@ pub struct Touchpad {
107 #[knuffel(child)]107 #[knuffel(child)]
108 pub tap: bool,108 pub tap: bool,
109 #[knuffel(child)]109 #[knuffel(child)]
110+ pub dwt: bool,
111+ #[knuffel(child)]
110 pub natural_scroll: bool,112 pub natural_scroll: bool,
111 #[knuffel(child, unwrap(argument), default)]113 #[knuffel(child, unwrap(argument), default)]
112 pub accel_speed: f64,114 pub accel_speed: f64,
@@ -640,6 +642,7 @@ mod tests {
640 642
641 touchpad {643 touchpad {
642 tap644 tap
645+ dwt
643 accel-speed 0.2646 accel-speed 0.2
644 accel-profile "flat"647 accel-profile "flat"
645 }648 }
@@ -727,6 +730,7 @@ mod tests {
727 },730 },
728 touchpad: Touchpad {731 touchpad: Touchpad {
729 tap: true,732 tap: true,
733+ dwt: true,
730 natural_scroll: false,734 natural_scroll: false,
731 accel_speed: 0.2,735 accel_speed: 0.2,
732 accel_profile: Some(AccelProfile::Flat),736 accel_profile: Some(AccelProfile::Flat),
resources/default-config.kdlmodified+1 -0
@@ -27,6 +27,7 @@ input {
27 // Omitting settings disables them, or leaves them at their default values.27 // Omitting settings disables them, or leaves them at their default values.
28 touchpad {28 touchpad {
29 tap29 tap
30+ // dwt
30 natural-scroll31 natural-scroll
31 // accel-speed 0.232 // accel-speed 0.2
32 // accel-profile "flat"33 // accel-profile "flat"
src/input.rsmodified+1 -0
@@ -94,6 +94,7 @@ impl State {
94 if is_touchpad {94 if is_touchpad {
95 let c = &self.niri.config.borrow().input.touchpad;95 let c = &self.niri.config.borrow().input.touchpad;
96 let _ = device.config_tap_set_enabled(c.tap);96 let _ = device.config_tap_set_enabled(c.tap);
97+ let _ = device.config_dwt_set_enabled(c.dwt);
97 let _ = device.config_scroll_set_natural_scroll_enabled(c.natural_scroll);98 let _ = device.config_scroll_set_natural_scroll_enabled(c.natural_scroll);
98 let _ = device.config_accel_set_speed(c.accel_speed);99 let _ = device.config_accel_set_speed(c.accel_speed);
99 100