sway: order input config from least to most specific (#7684)

Workaround for https://github.com/swaywm/sway/issues/7271.
This commit is contained in:
novenary
2025-09-17 06:22:28 +03:00
committed by GitHub
parent ec73c06d34
commit 75f97fcbe3
3 changed files with 19 additions and 1 deletions

View File

@@ -7,6 +7,8 @@
let
inherit (lib)
concatStringsSep
filterAttrs
hasPrefix
mapAttrsToList
mkIf
mkOption
@@ -471,7 +473,9 @@ let
(keycodebindingsStr keycodebindings)
]
++ optional (builtins.attrNames bindswitches != [ ]) (bindswitchesStr bindswitches)
++ mapAttrsToList inputStr input
++ mapAttrsToList inputStr (filterAttrs (n: v: n == "*") input)
++ mapAttrsToList inputStr (filterAttrs (n: v: hasPrefix "type:" n) input)
++ mapAttrsToList inputStr (filterAttrs (n: v: n != "*" && !(hasPrefix "type:" n)) input)
++ mapAttrsToList outputStr output # outputs
++ mapAttrsToList seatStr seat # seats
++ mapAttrsToList (modeStr cfg.config.bindkeysToCode) modes # modes

View File

@@ -74,6 +74,14 @@ input "*" {
xkb_variant dvorak
}
input "type:pointer" {
accel_profile flat
}
input "2:10:TPPS/2_Elan_TrackPoint" {
accel_profile adaptive
}
output "HDMI-A-2" {
bg ~/path/to/background.png fill
}

View File

@@ -13,6 +13,12 @@
"*" = {
xkb_variant = "dvorak";
};
"type:pointer" = {
accel_profile = "flat";
};
"2:10:TPPS/2_Elan_TrackPoint" = {
accel_profile = "adaptive";
};
};
output = {
"HDMI-A-2" = {