sway: Support multiple keyboards

This commit is contained in:
traxys 2022-08-15 18:53:45 +02:00
parent bf58ac712c
commit 730b5df5ee
2 changed files with 19 additions and 19 deletions

View file

@ -15,9 +15,9 @@ with builtins; {
extraInfo.inputs = {
keyboard = mkOption {
type = types.nullOr types.str;
type = types.listOf types.str;
description = "Sway keyboard identifier";
default = null;
default = [];
};
touchpad = mkOption {
type = types.nullOr types.str;

View file

@ -130,28 +130,28 @@ in {
];
input = let
inputs = config.extraInfo.inputs;
inputsCfg = [
(
if inputs.keyboard != null
then {
name = inputs.keyboard;
inputsCfg =
[
(
if inputs.touchpad != null
then {
name = inputs.touchpad;
value = {dwt = "disable";};
}
else null
)
]
++ (
builtins.map (k: {
name = k;
value = {
xkb_layout = "us";
xkb_variant = "dvp";
xkb_options = "compose:102";
};
}
else null
)
(
if inputs.touchpad != null
then {
name = inputs.touchpad;
value = {dwt = "disable";};
}
else null
)
];
})
inputs.keyboard
);
in
builtins.listToAttrs inputsCfg;
fonts = common.mkFont cfg.font;