Xremap: Difference between revisions
Added: a reference for installing the flake module, instructions on how to remap a copilot key |
m →Remapping the Copilot key: Corrected code that doesn't work anymore and added more instructions |
||
| (One intermediate revision by the same user not shown) | |||
| Line 6: | Line 6: | ||
An increasing number of new laptops come with a Copilot key that you might want to remap. Follow these steps to do so: | An increasing number of new laptops come with a Copilot key that you might want to remap. Follow these steps to do so: | ||
Start a shell with keyd available <code>nix-shell -p keyd</code> to monitor what the Copilot key does and see your keyboard id. From that shell, run <code>sudo keyd monitor</code> and press the Copilot key. | |||
<syntaxhighlight> | |||
AT Translated Set 2 keyboard 0001:0001:09b4e68d leftmeta down | |||
AT Translated Set 2 keyboard 0001:0001:09b4e68d leftshift down | |||
AT Translated Set 2 keyboard 0001:0001:09b4e68d f23 down | |||
AT Translated Set 2 keyboard 0001:0001:09b4e68d f23 up | |||
AT Translated Set 2 keyboard 0001:0001:09b4e68d leftshift up | |||
AT Translated Set 2 keyboard 0001:0001:09b4e68d leftmeta up | |||
</syntaxhighlight> | |||
Then translate the names of keys to the ones used by Xremap. | |||
You may then edit your configuration accordingly: | |||
{{file|/etc/nixos/configuration.nix|nix|<nowiki> | {{file|/etc/nixos/configuration.nix|nix|<nowiki> | ||
| Line 12: | Line 27: | ||
package = pkgs.xremap; # Use the official package to skip building xremap from source | package = pkgs.xremap; # Use the official package to skip building xremap from source | ||
userName = "username"; # The username of your user | userName = "username"; # The username of your user | ||
yamlConfig = '' | |||
experimental_map: | |||
keys | - chords: | ||
- keys: [Super_L, Shift_L, F23] | |||
actions: Ctrl_R | |||
timeout: 30 | |||
''; | |||
}; | }; | ||
</nowiki>}} | </nowiki>}} | ||
| Line 24: | Line 40: | ||
This configuration was made by referring to a [https://github.com/xremap/xremap/discussions/762 GitHub discussion]. | This configuration was made by referring to a [https://github.com/xremap/xremap/discussions/762 GitHub discussion]. | ||
{{note| | {{note|At the time of writing, the above works as of Xremap version <code>0.14.19</code> in the <code>nixpkgs-unstable</code> channel. The flake version provided version <code>0.15.1</code>. This version mismatch might cause errors. So adjust your configuration accordingly.}} | ||