sway: add propagate --to-code for modes (#2176)

Propagates the bindkeysToCode setting which adds --to-code to the keybindings in mode configs.

Closes #2174
This commit is contained in:
Sumner Evans 2021-07-15 07:09:54 -06:00 committed by GitHub
parent 775cb20bd4
commit f56a087cbc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 151 additions and 6 deletions

View file

@ -179,7 +179,7 @@ let
${keybindingsStr { keybindings = keybindingDefaultWorkspace; }}
${keybindingsStr { keybindings = keybindingsRest; }}
${keycodebindingsStr keycodebindings}
${concatStringsSep "\n" (mapAttrsToList modeStr modes)}
${concatStringsSep "\n" (mapAttrsToList (modeStr false) modes)}
${concatStringsSep "\n" (mapAttrsToList assignStr assigns)}
${concatStringsSep "\n" (map barStr bars)}
${optionalString (gaps != null) gapsStr}

View file

@ -37,9 +37,12 @@ rec {
];
barColorSetStr = c: concatStringsSep " " [ c.border c.background c.text ];
modeStr = name: keybindings: ''
modeStr = bindkeysToCode: name: keybindings: ''
mode "${name}" {
${keybindingsStr { inherit keybindings; }}
${keybindingsStr {
inherit keybindings;
bindsymArgs = lib.optionalString bindkeysToCode "--to-code";
}}
}
'';

View file

@ -300,7 +300,7 @@ let
mapAttrsToList inputStr input # inputs
++ mapAttrsToList outputStr output # outputs
++ mapAttrsToList seatStr seat # seats
++ mapAttrsToList modeStr modes # modes
++ mapAttrsToList (modeStr cfg.config.bindkeysToCode) modes # modes
++ mapAttrsToList assignStr assigns # assigns
++ map barStr bars # bars
++ optional (gaps != null) gapsStr # gaps