summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKj Tsanaktsidis <kjtsanaktsidis@groq.com>2025-09-12 20:16:34 +1000
committerKj Tsanaktsidis <kjtsanaktsidis@groq.com>2025-09-12 20:16:34 +1000
commit49cdcb948cdb55cae09ba3643ed97aa2d6410994 (patch)
tree053915a38cf912af075ec62c6e50da3f9f63a0bc
parent10da26085e9164a3d72159e985000b4a9ca2da40 (diff)
fix vt escape
-rw-r--r--kj-laptop01/configuration.nix28
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;
+ };
+ };
}