palette/nixos/kanata.nix

81 lines
2.9 KiB
Nix
Raw Normal View History

{
config,
lib,
pkgs,
...
}: {
services.kanata.enable = true;
services.kanata.keyboards.mykbd.config = ''
(defsrc
;; grv 1 2 3 4 5 6 7 8 9 0 - = bspc
tab q w f p b j l u y ' [ ]
caps a r s t g m n e i o
lsft z x c d v k h , . /
lctl lmet lalt spc ret ;
)
(deflayer default
;;tab q w f d b j l u y ' [ ]
_ _ _ _ _ _ _ _ _ _ _ _ _
;;caps a r s t g m n e i o
_ _ _ @chs @cht _ _ _ _ _ _
;;lsft z x c d v k h , . /
_ _ _ _ _ _ _ _ _ _ _
;;lctl lmet lalt spc ret ;
_ _ _ @chspc @chret _
)
(deflayer arrows
;;tab q w f p b j l u y ' [ ]
XX XX XX XX XX XX XX XX XX XX XX XX XX
;;caps a r s t g m n e i o
XX XX XX XX XX XX left down up rght XX
;;lsft z x c d v k h , . /
XX XX XX XX XX XX XX XX XX XX XX
;;lctl lmet lalt spc ret ;
XX XX XX XX XX XX
)
(deflayer num
;;tab q w f p b j l u y ' [ ]
XX XX XX XX XX XX XX 7 8 9 XX XX XX
;;caps a r s t g m n e i o
XX XX XX XX XX XX XX 4 5 6 XX
;;lsft z x c d v k h , . /
XX XX XX XX XX XX XX 1 2 3 XX
;;lctl lmet lalt spc ret ;
XX XX XX XX XX 0
)
(deflayer misc
;;tab q w f p b j l u y ' [ ]
XX S-1 S-2 S-3 S-4 S-5 S-6 S-7 S-8 S-9 XX XX XX
;;caps a r s t g m n e i o
XX XX XX XX XX XX XX [ S-[ XX XX
;;lsft z x c d v k h , . /
XX XX XX XX XX XX XX ] S-] XX XX
;;lctl lmet lalt spc ret ;
XX XX XX XX XX XX
)
(defalias
num (layer-while-held num)
arrows (layer-while-held arrows)
misc (layer-while-held misc)
cht (chord example t)
chs (chord example s)
chspc (chord example spc)
chret (chord example ret)
)
(defchords example 500
(t) t
(s) s
(spc) spc
(ret) ret
(spc s) @num
(spc t) @arrows
(spc ret) @misc
)
'';
}