Keyboard Layout Customization: Difference between revisions

Rhendric (talk | contribs)
Simple: Update xkb options
Fenhl (talk | contribs)
added keyd section
 
(2 intermediate revisions by 2 users not shown)
Line 20: Line 20:
services.xserver.xkb = {
services.xserver.xkb = {
   layout = "us,ru";
   layout = "us,ru";
  # Note that the trailing comma is required: https://github.com/NixOS/nixpkgs/issues/359830
   variant = "workman,";
   variant = "workman,";
   options = "grp:win_space_toggle";
   options = "grp:win_space_toggle";
Line 54: Line 55:


* <code>services.xserver.exportConfiguration</code>: Makes it so the above mentioned xkb directory (and the <code>xorg.conf</code> file) gets exported to <code>/etc/X11/xkb</code>, which is useful if you have to often look stuff up in it.
* <code>services.xserver.exportConfiguration</code>: Makes it so the above mentioned xkb directory (and the <code>xorg.conf</code> file) gets exported to <code>/etc/X11/xkb</code>, which is useful if you have to often look stuff up in it.
* <code>services.xserver.xkbDir</code>: Allows you to set a different xkb directory altogether. All the above mentioned things will use this instead of the default one in regards to xkb stuff.
* <code>services.xserver.xkb.dir</code>: Allows you to set a different xkb directory altogether. All the above mentioned things will use this instead of the default one in regards to xkb stuff.
* <code>console.useXkbConfig</code>: Makes it so the tty console has about the same layout as the one configured in the <code>services.xserver</code> options.
* <code>console.useXkbConfig</code>: Makes it so the tty console has about the same layout as the one configured in the <code>services.xserver</code> options.


Line 93: Line 94:
   services.xserver.displayManager.sessionCommands = "sleep 5 && ${pkgs.xorg.xmodmap}/bin/xmodmap -e 'keycode 43 = h H Left H' &";
   services.xserver.displayManager.sessionCommands = "sleep 5 && ${pkgs.xorg.xmodmap}/bin/xmodmap -e 'keycode 43 = h H Left H' &";
</syntaxhighlight>
</syntaxhighlight>
== Using keyd ==
[[keyd]] is another option to customize keyboard behavior, and may be useful when a single keypress should produce multiple characters at once, e.g. a letter with a combining diacritic.


[[Category:Desktop]]
[[Category:Desktop]]
[[Category:Hardware]]
[[Category:Hardware]]