diff options
| author | Caroline Larimore <caroline@larimo.re> | 2024-05-21 17:01:56 -0700 |
|---|---|---|
| committer | Caroline Larimore <caroline@larimo.re> | 2024-05-21 17:01:56 -0700 |
| commit | 8fc8554d8a60f5acda74462c3ff19450a5443547 (patch) | |
| tree | bb644b3b554037babf7fd16464cd6cbfb3900412 | |
| parent | f71b3fe651e8a549f4d26b6aa84eaf8ca1a7e3e7 (diff) | |
Swap alt and meta keys using keyd
| -rw-r--r-- | home/i3.nix | 5 | ||||
| -rw-r--r-- | system/default.nix | 1 | ||||
| -rw-r--r-- | system/keyd.nix | 23 |
3 files changed, 27 insertions, 2 deletions
diff --git a/home/i3.nix b/home/i3.nix index 86d2e05..2df6dc9 100644 --- a/home/i3.nix +++ b/home/i3.nix @@ -5,7 +5,8 @@ enable = true; config = let - mod = "Mod1"; + #NOTE: Alt (Mod1) and meta (Mod4) have been swapped by keyd. + mod = "Mod4"; ws0 = "0:Main"; ws1 = "1:Terminal"; @@ -117,7 +118,7 @@ "Shift+Print" = "exec ${pkgs.flameshot}/bin/flameshot screen -c"; "Print" = "exec ${pkgs.flameshot}/bin/flameshot full -c"; "${mod}+Shift+s" = "exec ${pkgs.flameshot}/bin/flameshot gui -c"; - "Mod4+Shift+s" = "exec ${pkgs.flameshot}/bin/flameshot gui -c"; + "Mod1+Shift+s" = "exec ${pkgs.flameshot}/bin/flameshot gui -c"; "${mod}+Ctrl+Shift+s" = "exec ${pkgs.flameshot}/bin/flameshot launcher -c"; # Media keys 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"; + }; + }; + }; +} |