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

76 lines
2.1 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";
ara = "buckwalter";
cop = "";
ave = "";
"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/cop";
path = pkgs.fetchurl {
url = "http://www.moheb.de/download/cop";
sha256 = "1l0h6aq536hyinrh0i0ia355y229bjrlibii0sya5bmqh46vycia";
};
}
{
name = "symbols/ave";
path = pkgs.fetchurl {
url = "https://blog.simos.info/wp-content/uploads/2010/06/avestan.txt";
sha256 = "192zmmm3gxyhim39dsax7r87gsay2w5v2xkhwmvsfipjb60hwp5g";
};
}
])
];
};
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
}