flake and kbd

This commit is contained in:
Matt Nish-Lapidus 2025-05-16 13:35:05 -04:00
parent 7309e102bf
commit 05901af723
3 changed files with 37 additions and 18 deletions

View file

@ -1,5 +1,13 @@
{ inputs, pkgs, ... }:
let
k-vars = ''
(defvar
tap-timeout 100
hold-timeout 200)
'';
in
{
environment.systemPackages = [
pkgs.kanata
@ -16,11 +24,17 @@
services.kanata = {
enable = true;
keyboards = {
sinc = {
devices = [ "/dev/input/by-id/usb-Keebio_Sinc_Rev._4-event-kbd"
"/dev/input/by-id/usb-Keebio_Sinc_Rev._4-event-if02"
"/dev/input/by-id/usb-Keebio_Sinc_Rev._4-if02-event-joystick" ];
extraDefCfg = ''
process-unmapped-keys yes
concurrent-tap-hold yes
'';
config = ''
(defsrc
esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 prtsc
@ -30,10 +44,12 @@
lsft z x c v b n m , . / rsft up pgdn
lctl slck lmet lalt spc ralt rmet rctrl left down right)
${k-vars}
(defalias
supesc (tap-hold-press 100 200 esc lmet)
sp-lsft (tap-hold-press 100 200 S-9 lsft)
sp-rsft (tap-hold-press 100 200 S-0 lsft)
supesc (tap-hold-press $tap-timeout $hold-timeout esc lmet)
sp-lsft (tap-hold-press $tap-timeout $hold-timeout S-9 lsft)
sp-rsft (tap-hold-press $tap-timeout $hold-timeout S-0 lsft)
controls (layer-while-held controls))
(deflayer qwerty
@ -65,10 +81,12 @@
lsft z x c v b n m , . / rsft
lctrl lmet lalt spc ralt rctrl)
${k-vars}
(defalias
supesc (tap-hold-press 100 200 esc lmet)
sp-lsft (tap-hold-press 100 200 S-9 lsft)
sp-rsft (tap-hold-press 100 200 S-0 lsft))
supesc (tap-hold-press $tap-timeout $hold-timeout esc lmet)
sp-lsft (tap-hold-press $tap-timeout $hold-timeout S-9 lsft)
sp-rsft (tap-hold-press $tap-timeout $hold-timeout S-0 lsft))
(deflayer qwerty
grv 1 2 3 4 5 6 7 8 9 0 - = bspc