summaryrefslogtreecommitdiff
path: root/modules/alt-arrow-vt.nix
diff options
context:
space:
mode:
authorKj Tsanaktsidis <kjtsanaktsidis@groq.com>2026-01-09 11:58:31 +1100
committerKj Tsanaktsidis <kjtsanaktsidis@groq.com>2026-01-09 11:58:31 +1100
commit98e94297af73c583c9636c99772b2c1c34f98743 (patch)
tree1ac244e55b6d544d556b2327308d07708350e824 /modules/alt-arrow-vt.nix
parentf5686b8e377ce3ecbf617783b4f2398423cb19fd (diff)
some refactor
Diffstat (limited to 'modules/alt-arrow-vt.nix')
-rw-r--r--modules/alt-arrow-vt.nix29
1 files changed, 29 insertions, 0 deletions
diff --git a/modules/alt-arrow-vt.nix b/modules/alt-arrow-vt.nix
new file mode 100644
index 0000000..d0dbb90
--- /dev/null
+++ b/modules/alt-arrow-vt.nix
@@ -0,0 +1,29 @@
+{
+ pkgs,
+ ...
+}:
+{
+ # Disable Alt+Left/Right virtual terminal switching
+ 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;
+ };
+ };
+
+}