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