1
0
mirror of https://github.com/kmein/niveum synced 2026-03-16 10:11:08 +01:00
Files
niveum/configs/keyboard.nix

79 lines
2.0 KiB
Nix
Raw Normal View History

2022-03-10 21:52:12 +01:00
{
pkgs,
lib,
...
}: let
commaSep = builtins.concatStringsSep ",";
xkbOptions = ["compose:caps" "terminate:ctrl_alt_bksp" "grp:ctrls_toggle"];
languages = {
de = "T3";
gr = "polytonic";
ru = "phonetic";
arabic = "";
coptic = "";
avestan = "";
gothic = "";
"in" = "san-kagapa";
2022-11-09 11:07:44 +01:00
il = "phonetic";
};
defaultLanguage = "de";
in {
2022-04-25 11:34:07 +02:00
# man 7 xkeyboard-config
2019-04-19 03:11:51 +02:00
services.xserver = {
2022-06-05 17:24:11 +02:00
layout = "de";
2022-04-25 11:52:27 +02:00
# T3: https://upload.wikimedia.org/wikipedia/commons/a/a9/German-Keyboard-Layout-T3-Version1-large.png
# buckwalter: http://www.qamus.org/transliteration.htm
2022-06-05 17:24:11 +02:00
xkbVariant = "T3";
2022-11-09 11:07:44 +01:00
xkbOptions = commaSep xkbOptions;
2019-04-19 03:11:51 +02:00
libinput.enable = true;
xkbDir = pkgs.symlinkJoin {
name = "x-keyboard-directory";
paths = [
"${pkgs.xkeyboard_config}/etc/X11/xkb"
(pkgs.linkFarm "custom-x-keyboards" [
{
name = "symbols/arabic";
path = ../lib/keyboards/arabic;
}
2023-04-30 15:42:10 +02:00
{
name = "symbols/coptic";
path = ../lib/keyboards/coptic;
2023-04-30 15:42:10 +02:00
}
{
name = "symbols/gothic";
path = ../lib/keyboards/gothic;
}
{
name = "symbols/avestan";
path = ../lib/keyboards/avestan;
}
])
];
};
2019-04-19 03:11:51 +02:00
};
console.keyMap = "de";
2020-05-31 18:24:15 +02:00
environment.systemPackages =
lib.mapAttrsToList
(language: variant:
pkgs.writers.writeDashBin "kb-${language}" ''
${pkgs.xorg.setxkbmap}/bin/setxkbmap ${defaultLanguage},${language} ${languages.${defaultLanguage}},${variant} ${toString (map (option: "-option ${option}") xkbOptions)}
'')
languages;
2020-05-31 18:24:15 +02:00
# improve held key rate
2022-03-10 21:52:12 +01:00
services.xserver.displayManager.sessionCommands = "${pkgs.xorg.xset}/bin/xset r rate 300 50";
2022-04-25 11:38:10 +02:00
systemd.user.services.gxkb = {
wantedBy = ["graphical-session.target"];
serviceConfig = {
SyslogIdentifier = "gxkb";
ExecStart = "${pkgs.gxkb}/bin/gxkb";
Restart = "always";
RestartSec = "15s";
StartLimitBurst = 0;
};
};
2019-04-19 03:11:51 +02:00
}