diff options
| -rw-r--r-- | kj-laptop01/configuration.nix | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/kj-laptop01/configuration.nix b/kj-laptop01/configuration.nix index 354f688..610ecd3 100644 --- a/kj-laptop01/configuration.nix +++ b/kj-laptop01/configuration.nix @@ -110,11 +110,25 @@ programs.zsh.enable = true; # Disable Alt+Left/Right virtual terminal switching - console.keyMap = pkgs.runCommand "disable-vt-switch.map" { - nativeBuildInputs = [ pkgs.kbd ]; - } '' - ${pkgs.kbd}/bin/dumpkeys ${pkgs.kbd}/share/keymaps/i386/qwerty/us.map.gz | \ - sed 's/alt keycode 105 = Console_12/alt keycode 105 = noop/' | \ - sed 's/alt keycode 106 = Console_18/alt keycode 106 = noop/' > $out - ''; + console.keyMap = "us"; + + # Create systemd service to disable only Alt+Arrow VT switching + systemd.services.disable-alt-arrow-vt = { + description = "Disable Alt+Arrow VT switching"; + wantedBy = [ "multi-user.target" ]; + after = [ "systemd-vconsole-setup.service" ]; + script = '' + # Define string sequences for Alt+Arrow that generate proper terminal escape sequences + cat << 'EOF' | ${pkgs.kbd}/bin/loadkeys + string F200 = "\033[1;3D" + string F201 = "\033[1;3C" + alt keycode 105 = F200 + alt keycode 106 = F201 + EOF + ''; + serviceConfig = { + Type = "oneshot"; + RemainAfterExit = true; + }; + }; } |
