Keyd: Difference between revisions
No edit summary |
added Unicode Support section |
||
| (One intermediate revision by one other user not shown) | |||
| Line 59: | Line 59: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Note that for now, ids MUST be present in the file, so it means that layouts cannot be defined this way as reported in https://github.com/NixOS/nixpkgs/issues/284797. Yet, you can still use | Note that for now, ids MUST be present in the file, so it means that layouts cannot be defined this way as reported in https://github.com/NixOS/nixpkgs/issues/284797. Yet, you can still use <code>environment.etc</code> to create them as usual. | ||
=== Disabling Copilot key === | === Disabling Copilot key === | ||
| Line 87: | Line 87: | ||
settings = { | settings = { | ||
main = { | main = { | ||
## taking the key combination from the monitor command and remapping it to | ## taking the key combination from the monitor command and remapping it to meta / super key | ||
"leftshift+leftmeta+f23" = "layer( | "leftshift+leftmeta+f23" = "layer(meta)"; | ||
}; | }; | ||
}; | }; | ||
| Line 96: | Line 96: | ||
</nowiki>}} | </nowiki>}} | ||
=== Dealing with | === Dealing with Layouts & Unicode Support === | ||
If you want to define a layout (like you custom qwerty), you can also do it directly in keyd, but keep in mind that keyd can manipulate keycodes (basically the position of the key on the keyboard that is named based on a qwerty layout by convention), but not keysyms (what actual symbol you will type), since keyd they basically recreates a fake keyboard that will be, later in the chain, processed by X11/ibus/… So if you want to use a layout, you need to be sure that the layout used by the user is set to US (e.g. in X11 via <code>setxkbmap us</code>). If you want to produce symbols not accessible by the US keyboard map (e.g. emoji etc), then keyd will basically create for you a XCompose file that you need to include (you may also need to enable Ibus for this), that is located in <code>"${keyd}/share/keyd/keyd.compose"</code>. See keyd documentation for more details. | If you want to define a layout (like you custom qwerty), you can also do it directly in keyd, but keep in mind that keyd can manipulate keycodes (basically the position of the key on the keyboard that is named based on a qwerty layout by convention), but not keysyms (what actual symbol you will type), since keyd they basically recreates a fake keyboard that will be, later in the chain, processed by X11/ibus/… So if you want to use a layout, you need to be sure that the layout used by the user is set to US (e.g. in X11 via <code>setxkbmap us</code>). If you want to produce symbols not accessible by the US keyboard map (e.g. emoji etc), then keyd will basically create for you a XCompose file that you need to include (you may also need to enable Ibus for this), that is located in <code>"${keyd}/share/keyd/keyd.compose"</code>. See keyd documentation for more details. | ||
The compose file can be enabled on a per-user basis by setting <code>~/.XCompose</code> to be a copy of or a symlink to that compose file. In home-manager, this can be configured like so: | |||
{{file|/home/<user>/.config/home-manager/home.nix|nix|<nowiki> | |||
home.file.".XCompose".source = "${pkgs.keyd}/share/keyd/keyd.compose" | |||
</nowiki>}} | |||
Alternatively, the compose file can be adjusted system-wide by setting the $XCOMPOSEFILE environment variable. This can be adjusted set in your configuration like so: | |||
{{file|/etc/nixos/configuration.nix|nix|<nowiki> | |||
environment.sessionVariables."XCOMPOSEFILE" = "${pkgs.keyd}/share/keyd/keyd.compose" | |||
</nowiki>}} | |||
However, this approach is less reliable, and may not work with all applications, such as web browsers or electron apps. | |||