diff --git a/Cargo.lock b/Cargo.lock index fd40567..2d74b99 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1585,6 +1585,7 @@ dependencies = [ "input-sys", "io-lifetimes 1.0.11", "libc", + "log", "udev", ] @@ -2057,6 +2058,7 @@ dependencies = [ "directories", "futures-util", "git-version", + "input", "keyframe", "libc", "log", diff --git a/Cargo.toml b/Cargo.toml index 64f1d41..0ef2a15 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -50,6 +50,7 @@ clap = { version = "4.4.18", features = ["derive", "string"] } directories = "5.0.1" futures-util = { version = "0.3.30", default-features = false, features = ["std", "io"] } git-version = "0.3.9" +input = { version = "0.9.0", features = ["libinput_1_21"] } keyframe = { version = "1.1.1", default-features = false } libc = "0.2.153" log = { version = "0.4.20", features = ["max_level_trace", "release_max_level_debug"] } diff --git a/niri-config/src/lib.rs b/niri-config/src/lib.rs index d8ccad5..bd8b643 100644 --- a/niri-config/src/lib.rs +++ b/niri-config/src/lib.rs @@ -124,6 +124,8 @@ pub struct Touchpad { #[knuffel(child)] pub dwt: bool, #[knuffel(child)] + pub dwtp: bool, + #[knuffel(child)] pub natural_scroll: bool, #[knuffel(child, unwrap(argument), default)] pub accel_speed: f64, @@ -765,6 +767,7 @@ mod tests { touchpad { tap dwt + dwtp accel-speed 0.2 accel-profile "flat" tap-button-map "left-middle-right" @@ -867,6 +870,7 @@ mod tests { touchpad: Touchpad { tap: true, dwt: true, + dwtp: true, natural_scroll: false, accel_speed: 0.2, accel_profile: Some(AccelProfile::Flat), diff --git a/resources/default-config.kdl b/resources/default-config.kdl index 5ec5eb3..268f3fd 100644 --- a/resources/default-config.kdl +++ b/resources/default-config.kdl @@ -28,6 +28,7 @@ input { touchpad { tap // dwt + // dwtp natural-scroll // accel-speed 0.2 // accel-profile "flat" diff --git a/src/input.rs b/src/input.rs index 0371e93..387969f 100644 --- a/src/input.rs +++ b/src/input.rs @@ -1522,6 +1522,7 @@ pub fn apply_libinput_settings(config: &niri_config::Input, device: &mut input:: let c = &config.touchpad; let _ = device.config_tap_set_enabled(c.tap); let _ = device.config_dwt_set_enabled(c.dwt); + let _ = device.config_dwtp_set_enabled(c.dwtp); let _ = device.config_scroll_set_natural_scroll_enabled(c.natural_scroll); let _ = device.config_accel_set_speed(c.accel_speed);