From 9095b46c60fee21123d3146255ac2222de52e2e5 Mon Sep 17 00:00:00 2001 From: Martin Fischer Date: Mon, 26 Oct 2026 10:10:31 +0100 Subject: feat(hamac): remap TrackPoint buttons to prev/next tab --- nixos/hosts/hamac/default.nix | 23 +++++++++++++++++++++++ user/nvim/init.lua | 3 +++ 2 files changed, 26 insertions(+) diff --git a/nixos/hosts/hamac/default.nix b/nixos/hosts/hamac/default.nix index b5c473e..0d2cdc3 100644 --- a/nixos/hosts/hamac/default.nix +++ b/nixos/hosts/hamac/default.nix @@ -30,6 +30,29 @@ in ServerName ev ''; + # Remap the physical TrackPoint buttons to make them usable in keybindings. + services.evremap = { + enable = true; + settings = { + device_name = "TPPS/2 Elan TrackPoint"; + phys = "isa0060/serio1/input0"; + # I would use F13/F14 as the output but Firefox does not support remapping the + # prev/next tab shortcuts (https://bugzilla.mozilla.org/show_bug.cgi?id=2012210). + # So I just use the Firefox shortcuts as outputs. + # Left Alt gets remapped to Ctrl by XKB's ctrl(swap_lalt_lctl). + remap = [ + { + input = ["BTN_LEFT"]; + output = ["KEY_LEFTALT" "KEY_LEFTSHIFT" "KEY_TAB"]; + } + { + input = ["BTN_RIGHT"]; + output = ["KEY_LEFTALT" "KEY_TAB"]; + } + ]; + }; + }; + # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions # on your system were taken. It‘s perfectly fine and recommended to leave diff --git a/user/nvim/init.lua b/user/nvim/init.lua index 56552d1..c8aa8d7 100644 --- a/user/nvim/init.lua +++ b/user/nvim/init.lua @@ -156,6 +156,9 @@ require('blink.cmp').setup({ -- Clear search highlighting with Escape. vim.keymap.set('n', '', 'nohlsearch', { desc = 'Clear search highlight' }) +vim.keymap.set('n', '', 'tabprevious', { desc = 'Previous tab' }) +vim.keymap.set('n', '', 'tabnext', { desc = 'Next tab' }) + vim.keymap.set('n', '', function() local tool = vim.fs.root(vim.fn.getcwd(), '.git') and 'git' or nil pick.builtin.files({ tool = tool }) -- cgit v1.3.1