From 8fc8554d8a60f5acda74462c3ff19450a5443547 Mon Sep 17 00:00:00 2001 From: Caroline Larimore Date: Tue, 21 May 2024 17:01:56 -0700 Subject: Swap alt and meta keys using keyd --- system/default.nix | 1 + system/keyd.nix | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 system/keyd.nix (limited to 'system') diff --git a/system/default.nix b/system/default.nix index 8a8b05b..ca5412c 100644 --- a/system/default.nix +++ b/system/default.nix @@ -3,6 +3,7 @@ { imports = [ ./fonts.nix + ./keyd.nix ./networking.nix ./pipewire.nix ./xserver.nix diff --git a/system/keyd.nix b/system/keyd.nix new file mode 100644 index 0000000..6732912 --- /dev/null +++ b/system/keyd.nix @@ -0,0 +1,23 @@ +{ ... }: + +{ + services.keyd = { + enable = true; + + keyboards."*".settings = { + main = { + # Swap alt and meta keys. + # I prefer (physical) alt as my WM modifier key because it + # is easier to reach. This can collide with some programs + # shortcuts if they inlcude alt. Swapping alt and meta fixes + # this by making my WM mod key (software) meta, freeing up alt. + + leftalt = "leftmeta"; + leftmeta = "leftalt"; + + rightalt = "rightmeta"; + rightmeta = "rightalt"; + }; + }; + }; +} -- cgit v1.2.3