aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2026-10-26 10:10:31 +0100
committerMartin Fischer <martin@push-f.com>2026-10-26 16:49:21 +0100
commit9095b46c60fee21123d3146255ac2222de52e2e5 (patch)
treee1dcd44bc8355793b986be01c06a074505174e5c
parente1db0d1b5380704b833c2b15c4d36f405a9b5b79 (diff)
feat(hamac): remap TrackPoint buttons to prev/next tab
-rw-r--r--nixos/hosts/hamac/default.nix23
-rw-r--r--user/nvim/init.lua3
2 files changed, 26 insertions, 0 deletions
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', '<Esc>', '<cmd>nohlsearch<CR>', { desc = 'Clear search highlight' })
+vim.keymap.set('n', '<C-S-Tab>', '<cmd>tabprevious<CR>', { desc = 'Previous tab' })
+vim.keymap.set('n', '<C-Tab>', '<cmd>tabnext<CR>', { desc = 'Next tab' })
+
vim.keymap.set('n', '<C-p>', function()
local tool = vim.fs.root(vim.fn.getcwd(), '.git') and 'git' or nil
pick.builtin.files({ tool = tool })