sway: add option config.bindkeysToCode
Do not use `--to-code` by default in `bindsym`. PR #1289
This commit is contained in:
parent
0ee5c9536b
commit
85748171ec
|
@ -180,7 +180,7 @@ let
|
||||||
client.placeholder ${colorSetStr colors.placeholder}
|
client.placeholder ${colorSetStr colors.placeholder}
|
||||||
client.background ${colors.background}
|
client.background ${colors.background}
|
||||||
|
|
||||||
${keybindingsStr keybindings}
|
${keybindingsStr { inherit keybindings; }}
|
||||||
${keycodebindingsStr keycodebindings}
|
${keycodebindingsStr keycodebindings}
|
||||||
${concatStringsSep "\n" (mapAttrsToList modeStr modes)}
|
${concatStringsSep "\n" (mapAttrsToList modeStr modes)}
|
||||||
${concatStringsSep "\n" (mapAttrsToList assignStr assigns)}
|
${concatStringsSep "\n" (mapAttrsToList assignStr assigns)}
|
||||||
|
|
|
@ -8,10 +8,10 @@ rec {
|
||||||
concatStringsSep " " (mapAttrsToList (k: v: ''${k}="${v}"'') criteria)
|
concatStringsSep " " (mapAttrsToList (k: v: ''${k}="${v}"'') criteria)
|
||||||
}]";
|
}]";
|
||||||
|
|
||||||
keybindingsStr = keybindings:
|
keybindingsStr = { keybindings, bindsymArgs ? "" }:
|
||||||
concatStringsSep "\n" (mapAttrsToList (keycomb: action:
|
concatStringsSep "\n" (mapAttrsToList (keycomb: action:
|
||||||
optionalString (action != null) "bindsym ${
|
optionalString (action != null) "bindsym ${
|
||||||
lib.optionalString (moduleName == "sway") "--to-code "
|
lib.optionalString (bindsymArgs != "") "${bindsymArgs} "
|
||||||
}${keycomb} ${action}") keybindings);
|
}${keycomb} ${action}") keybindings);
|
||||||
|
|
||||||
keycodebindingsStr = keycodebindings:
|
keycodebindingsStr = keycodebindings:
|
||||||
|
@ -31,7 +31,7 @@ rec {
|
||||||
|
|
||||||
modeStr = name: keybindings: ''
|
modeStr = name: keybindings: ''
|
||||||
mode "${name}" {
|
mode "${name}" {
|
||||||
${keybindingsStr keybindings}
|
${keybindingsStr { inherit keybindings; }}
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
|
|
@ -139,6 +139,15 @@ let
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
bindkeysToCode = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
description = ''
|
||||||
|
Whether to make use of <option>--to-code</option> in keybindings.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
input = mkOption {
|
input = mkOption {
|
||||||
type = types.attrsOf (types.attrsOf types.str);
|
type = types.attrsOf (types.attrsOf types.str);
|
||||||
default = { };
|
default = { };
|
||||||
|
@ -259,7 +268,11 @@ let
|
||||||
client.placeholder ${colorSetStr colors.placeholder}
|
client.placeholder ${colorSetStr colors.placeholder}
|
||||||
client.background ${colors.background}
|
client.background ${colors.background}
|
||||||
|
|
||||||
${keybindingsStr keybindings}
|
${keybindingsStr {
|
||||||
|
inherit keybindings;
|
||||||
|
bindsymArgs =
|
||||||
|
lib.optionalString (cfg.config.bindkeysToCode) "--to-code";
|
||||||
|
}}
|
||||||
${keycodebindingsStr keycodebindings}
|
${keycodebindingsStr keycodebindings}
|
||||||
${concatStringsSep "\n" (mapAttrsToList inputStr input)}
|
${concatStringsSep "\n" (mapAttrsToList inputStr input)}
|
||||||
${concatStringsSep "\n" (mapAttrsToList outputStr output)}
|
${concatStringsSep "\n" (mapAttrsToList outputStr output)}
|
||||||
|
|
Loading…
Reference in a new issue