2023-02-19 22:47:42 +01:00
|
|
|
let
|
|
|
|
chord = from: to: { inherit from to; };
|
|
|
|
unmap = from: chord from [ ];
|
2024-01-31 02:59:03 +01:00
|
|
|
# I want my brackets to be aligned
|
|
|
|
sem = "semicolon";
|
2023-02-19 22:47:42 +01:00
|
|
|
commonChords = [
|
|
|
|
# {{{ Modifiers
|
2024-01-31 02:59:03 +01:00
|
|
|
# {{{ right
|
2023-02-27 19:47:06 +01:00
|
|
|
(chord [ "l" "n" ] [ "rightmeta" ])
|
2024-01-31 02:59:03 +01:00
|
|
|
(chord [ "k" "l" ] [ "rightshift" ])
|
|
|
|
(chord [ "j" "l" ] [ "rightctrl" ])
|
|
|
|
(chord [ "l" sem ] [ "rightalt" ])
|
2023-02-19 22:47:42 +01:00
|
|
|
(chord [ "j" "k" "l" ] [ "rightctrl" "rightshift" ])
|
2024-01-31 02:59:03 +01:00
|
|
|
(chord [ "k" "l" sem ] [ "rightalt" "rightshift" ])
|
|
|
|
(chord [ "j" "k" "l" sem ] [ "rightalt" "rightctrl" "rightshift" ])
|
2023-02-27 19:47:06 +01:00
|
|
|
(unmap [ "rightshift" ])
|
2023-02-19 23:52:14 +01:00
|
|
|
(unmap [ "rightctrl" ])
|
2023-02-27 19:47:06 +01:00
|
|
|
(unmap [ "rightalt" ])
|
|
|
|
(unmap [ "rightmeta" ])
|
2023-02-19 22:47:42 +01:00
|
|
|
# }}}
|
2024-01-31 02:59:03 +01:00
|
|
|
# {{{ left
|
|
|
|
(chord [ "s" "d" ] [ "leftshift" ])
|
|
|
|
(chord [ "s" "f" ] [ "leftctrl" ])
|
|
|
|
(chord [ "s" "a" ] [ "leftalt" ])
|
|
|
|
(chord [ "s" "d" "f" ] [ "leftctrl" "leftshift" ])
|
|
|
|
(chord [ "a" "s" "d" ] [ "leftalt" "leftshift" ])
|
|
|
|
(chord [ "a" "s" "d" "f" ] [ "leftalt" "leftctrl" "leftshift" ])
|
|
|
|
(unmap [ "leftalt" ])
|
|
|
|
(unmap [ "leftctrl" ])
|
|
|
|
# (unmap [ "leftshift" ]) # Useful for touhou
|
|
|
|
# }}}
|
|
|
|
# }}}
|
2023-02-19 22:47:42 +01:00
|
|
|
# {{{ Other special keys
|
|
|
|
(chord [ "g" "h" ] [ "backspace" ])
|
|
|
|
(chord [ "n" "v" ] [ "backslash" ])
|
|
|
|
(chord [ "d" "f" ] [ "tab" ])
|
|
|
|
(chord [ "e" "f" ] [ "enter" ])
|
|
|
|
(chord [ "q" "w" ] [ "esc" ])
|
|
|
|
(unmap [ "backspace" ])
|
|
|
|
(unmap [ "enter" ])
|
|
|
|
(unmap [ "tab" ])
|
|
|
|
(unmap [ "esc" ])
|
|
|
|
(unmap [ "backslash" ])
|
|
|
|
# }}}
|
|
|
|
# {{{ Tmux
|
2023-02-19 23:52:14 +01:00
|
|
|
(chord [ "a" "n" "k" "l" ] [ "leftctrl" "a" "n" ]) # Next tab in tmux
|
|
|
|
(chord [ "a" "j" "l" ] [ "leftctrl" "a" ]) # Tmux leader
|
2023-02-19 22:47:42 +01:00
|
|
|
# }}}
|
|
|
|
# {{{ WM keybinds
|
|
|
|
(chord [ "n" "l" "q" ] [ "leftmeta" "1" ])
|
|
|
|
(chord [ "n" "l" "w" ] [ "leftmeta" "2" ])
|
|
|
|
(chord [ "n" "l" "e" ] [ "leftmeta" "3" ])
|
|
|
|
(chord [ "n" "l" "r" ] [ "leftmeta" "4" ])
|
|
|
|
(chord [ "n" "l" "a" ] [ "leftmeta" "5" ])
|
|
|
|
(chord [ "n" "l" "s" ] [ "leftmeta" "6" ])
|
|
|
|
(chord [ "n" "l" "d" ] [ "leftmeta" "7" ])
|
|
|
|
(chord [ "n" "l" "f" ] [ "leftmeta" "8" ])
|
2023-09-13 17:42:37 +02:00
|
|
|
(chord [ "n" "l" "z" ] [ "leftmeta" "9" ])
|
|
|
|
(chord [ "n" "l" "x" ] [ "leftmeta" "0" ])
|
2023-09-18 02:15:13 +02:00
|
|
|
(chord [ "n" "k" "l" ] [ "leftmeta" "p" ])
|
2023-02-19 22:47:42 +01:00
|
|
|
# }}}
|
|
|
|
# {{{ Handled by vim
|
|
|
|
(chord [ "j" "k" ] [ "f10" ])
|
|
|
|
(chord [ "c" "p" ] [ "f11" ])
|
|
|
|
(chord [ "j" "i" ] [ "f12" ])
|
|
|
|
# }}}
|
|
|
|
];
|
|
|
|
in
|
|
|
|
{
|
|
|
|
services.slambda = {
|
|
|
|
enable = true;
|
|
|
|
|
|
|
|
keyboards.keychronK6 = {
|
2023-03-30 02:54:57 +02:00
|
|
|
delay = 30;
|
2023-02-19 22:47:42 +01:00
|
|
|
device = "/dev/input/by-id/usb-Keychron_Keychron_K6-event-kbd";
|
|
|
|
chords = commonChords;
|
|
|
|
};
|
|
|
|
|
|
|
|
keyboards.tethysLaptop = {
|
2023-03-30 02:54:57 +02:00
|
|
|
delay = 30;
|
2023-02-19 22:47:42 +01:00
|
|
|
device = "/dev/input/by-path/platform-i8042-serio-0-event-kbd";
|
|
|
|
chords = commonChords;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|