mirror of
https://github.com/kmein/niveum
synced 2026-03-16 10:11:08 +01:00
keyboard: set and use extraLayouts
This commit is contained in:
@@ -14,4 +14,4 @@
|
|||||||
> Deine Configs sind wunderschön <3 —[flxai](https://github.com/flxai/)
|
> Deine Configs sind wunderschön <3 —[flxai](https://github.com/flxai/)
|
||||||
|
|
||||||
## To do
|
## To do
|
||||||
- [ ] `services.xserver.xkb.extraLayouts`
|
- [ ] get rid of `nixinate`
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
{
|
{
|
||||||
|
config,
|
||||||
pkgs,
|
pkgs,
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
@@ -63,45 +64,42 @@ in
|
|||||||
|
|
||||||
# man 7 xkeyboard-config
|
# man 7 xkeyboard-config
|
||||||
services.xserver = {
|
services.xserver = {
|
||||||
exportConfiguration = true; # link /usr/share/X11 properly
|
exportConfiguration = lib.mkForce true; # link /usr/share/X11 properly
|
||||||
xkb.layout = defaultLanguage.code;
|
xkb.layout = defaultLanguage.code;
|
||||||
# T3: https://upload.wikimedia.org/wikipedia/commons/a/a9/German-Keyboard-Layout-T3-Version1-large.png
|
# T3: https://upload.wikimedia.org/wikipedia/commons/a/a9/German-Keyboard-Layout-T3-Version1-large.png
|
||||||
# buckwalter: http://www.qamus.org/transliteration.htm
|
# buckwalter: http://www.qamus.org/transliteration.htm
|
||||||
xkb.variant = defaultLanguage.variant;
|
xkb.variant = defaultLanguage.variant;
|
||||||
xkb.options = commaSep xkbOptions;
|
xkb.options = commaSep xkbOptions;
|
||||||
xkb.dir = pkgs.symlinkJoin {
|
xkb.extraLayouts = {
|
||||||
name = "x-keyboard-directory";
|
coptic = {
|
||||||
paths = [
|
languages = [ "cop" ];
|
||||||
"${pkgs.xkeyboard_config}/etc/X11/xkb"
|
description = "Coptic is the latest stage of the Egyptian language and was used by Egyptian Christians. The Coptic script is based on the Greek alphabet with some letters borrowed from Demotic Egyptian.";
|
||||||
(pkgs.linkFarm "custom-x-keyboards" (
|
symbolsFile = ./coptic;
|
||||||
lib.mapAttrsToList (name: value: {
|
};
|
||||||
name = "symbols/${name}";
|
avestan = {
|
||||||
path = value;
|
languages = [ "ave" ];
|
||||||
}) (lib.filterAttrs (_: value: !(value ? "code")) languages)
|
description = "Avestan is an ancient Iranian language known primarily from its use in the sacred texts of Zoroastrianism, the Avesta. It is an Indo-Iranian language that was spoken in ancient Persia.";
|
||||||
++ [
|
symbolsFile = ./avestan;
|
||||||
{
|
};
|
||||||
name = "symbols/ir";
|
gothic = {
|
||||||
path = ./farsi;
|
languages = [ "got" ];
|
||||||
}
|
description = "Gothic is an extinct East Germanic language that was spoken by the Goths. It is known primarily from the Codex Argenteus, a 6th-century manuscript containing a translation of the Bible into Gothic.";
|
||||||
]
|
symbolsFile = ./gothic;
|
||||||
))
|
};
|
||||||
];
|
farsi = {
|
||||||
|
languages = [ "fas" ];
|
||||||
|
description = "Farsi, also known as Persian, is an Indo-Iranian language spoken primarily in Iran, Afghanistan (where it is known as Dari), and Tajikistan (where it is called Tajik). It has a rich literary tradition and is written in a modified Arabic script.";
|
||||||
|
symbolsFile = ./farsi;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.etc."x11-locale".source = toString pkgs.xorg.libX11 + "share/X11/locale";
|
environment.etc."x11-locale".source = toString pkgs.xorg.libX11 + "share/X11/locale";
|
||||||
|
|
||||||
home-manager.users.me = {
|
home-manager.users.me = {
|
||||||
home.file =
|
home.file = {
|
||||||
lib.mapAttrs' (name: path: lib.nameValuePair ".xkb/symbols/${name}" { source = path; }) (
|
".XCompose".source = ./XCompose;
|
||||||
lib.filterAttrs (_: value: !(value ? "code")) languages
|
};
|
||||||
)
|
|
||||||
// {
|
|
||||||
".xkb/symbols/ir".source = ./farsi;
|
|
||||||
}
|
|
||||||
// {
|
|
||||||
".XCompose".source = ./XCompose;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
console.keyMap = "de";
|
console.keyMap = "de";
|
||||||
@@ -123,7 +121,7 @@ in
|
|||||||
swaymsg -s $SWAYSOCK 'input * xkb_options "${lib.concatStringsSep "," xkbOptions}"'
|
swaymsg -s $SWAYSOCK 'input * xkb_options "${lib.concatStringsSep "," xkbOptions}"'
|
||||||
fi
|
fi
|
||||||
''
|
''
|
||||||
) languages;
|
) (languages // config.services.xserver.xkb.extraLayouts);
|
||||||
|
|
||||||
# improve held key rate
|
# improve held key rate
|
||||||
services.xserver.displayManager.sessionCommands = "${pkgs.xorg.xset}/bin/xset r rate 300 50";
|
services.xserver.displayManager.sessionCommands = "${pkgs.xorg.xset}/bin/xset r rate 300 50";
|
||||||
|
|||||||
Reference in New Issue
Block a user