Merge pull request #244174 from rnhmjoj/pr-fix-extra-layouts
xorg.xkeyboardconfig_custom: update for 2.39
This commit is contained in:
commit
dfcc258054
|
@ -29,10 +29,10 @@ let
|
||||||
mkKeyboardTest = layout: { extraConfig ? {}, tests }: with pkgs.lib; makeTest {
|
mkKeyboardTest = layout: { extraConfig ? {}, tests }: with pkgs.lib; makeTest {
|
||||||
name = "keymap-${layout}";
|
name = "keymap-${layout}";
|
||||||
|
|
||||||
machine.console.keyMap = mkOverride 900 layout;
|
nodes.machine.console.keyMap = mkOverride 900 layout;
|
||||||
machine.services.xserver.desktopManager.xterm.enable = false;
|
nodes.machine.services.xserver.desktopManager.xterm.enable = false;
|
||||||
machine.services.xserver.layout = mkOverride 900 layout;
|
nodes.machine.services.xserver.layout = mkOverride 900 layout;
|
||||||
machine.imports = [ ./common/x11.nix extraConfig ];
|
nodes.machine.imports = [ ./common/x11.nix extraConfig ];
|
||||||
|
|
||||||
testScript = ''
|
testScript = ''
|
||||||
import json
|
import json
|
||||||
|
@ -201,4 +201,33 @@ in pkgs.lib.mapAttrs mkKeyboardTest {
|
||||||
extraConfig.console.keyMap = "de";
|
extraConfig.console.keyMap = "de";
|
||||||
extraConfig.services.xserver.layout = "de";
|
extraConfig.services.xserver.layout = "de";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
custom = {
|
||||||
|
tests = {
|
||||||
|
us.qwerty = [ "a" "b" "g" "d" "z" "shift-2" "shift-3" ];
|
||||||
|
us.expect = [ "a" "b" "g" "d" "z" "@" "#" ];
|
||||||
|
greek.qwerty = map (x: "alt_r-${x}")
|
||||||
|
[ "a" "b" "g" "d" "z" ];
|
||||||
|
greek.expect = [ "α" "β" "γ" "δ" "ζ" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
extraConfig.console.useXkbConfig = true;
|
||||||
|
extraConfig.services.xserver.layout = "us-greek";
|
||||||
|
extraConfig.services.xserver.extraLayouts.us-greek =
|
||||||
|
{ description = "US layout with alt-gr greek";
|
||||||
|
languages = [ "eng" ];
|
||||||
|
symbolsFile = pkgs.writeText "us-greek" ''
|
||||||
|
xkb_symbols "us-greek"
|
||||||
|
{
|
||||||
|
include "us(basic)"
|
||||||
|
include "level3(ralt_switch)"
|
||||||
|
key <LatA> { [ a, A, Greek_alpha ] };
|
||||||
|
key <LatB> { [ b, B, Greek_beta ] };
|
||||||
|
key <LatG> { [ g, G, Greek_gamma ] };
|
||||||
|
key <LatD> { [ d, D, Greek_delta ] };
|
||||||
|
key <LatZ> { [ z, Z, Greek_zeta ] };
|
||||||
|
};
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -579,28 +579,6 @@ self: super:
|
||||||
${optionalString (symbolsFile != null) "cp '${symbolsFile}' 'symbols/${name}'"}
|
${optionalString (symbolsFile != null) "cp '${symbolsFile}' 'symbols/${name}'"}
|
||||||
${optionalString (typesFile != null) "cp '${typesFile}' 'types/${name}'"}
|
${optionalString (typesFile != null) "cp '${typesFile}' 'types/${name}'"}
|
||||||
|
|
||||||
# patch makefiles
|
|
||||||
for type in compat geometry keycodes symbols types; do
|
|
||||||
if ! test -f "$type/${name}"; then
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
test "$type" = geometry && type_name=geom || type_name=$type
|
|
||||||
${ed}/bin/ed -v $type/Makefile.am <<EOF
|
|
||||||
/''${type_name}_DATA =
|
|
||||||
a
|
|
||||||
${name} \\
|
|
||||||
.
|
|
||||||
w
|
|
||||||
EOF
|
|
||||||
${ed}/bin/ed -v $type/Makefile.in <<EOF
|
|
||||||
/''${type_name}_DATA =
|
|
||||||
a
|
|
||||||
${name} \\
|
|
||||||
.
|
|
||||||
w
|
|
||||||
EOF
|
|
||||||
done
|
|
||||||
|
|
||||||
# add model description
|
# add model description
|
||||||
${ed}/bin/ed -v rules/base.xml <<EOF
|
${ed}/bin/ed -v rules/base.xml <<EOF
|
||||||
/<\/modelList>
|
/<\/modelList>
|
||||||
|
|
Loading…
Reference in a new issue