1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 19:46:05 +01:00

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
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 19 additions and 1 deletions

View file

@ -7,6 +7,8 @@
let let
inherit (lib) inherit (lib)
concatStringsSep concatStringsSep
filterAttrs
hasPrefix
mapAttrsToList mapAttrsToList
mkIf mkIf
mkOption mkOption
@ -471,7 +473,9 @@ let
(keycodebindingsStr keycodebindings) (keycodebindingsStr keycodebindings)
] ]
++ optional (builtins.attrNames bindswitches != [ ]) (bindswitchesStr bindswitches) ++ 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 outputStr output # outputs
++ mapAttrsToList seatStr seat # seats ++ mapAttrsToList seatStr seat # seats
++ mapAttrsToList (modeStr cfg.config.bindkeysToCode) modes # modes ++ mapAttrsToList (modeStr cfg.config.bindkeysToCode) modes # modes

View file

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

View file

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