lot of stuff

This commit is contained in:
2025-11-25 21:22:00 +02:00
parent f4b43e8362
commit 3ed3f50d86
10 changed files with 485 additions and 274 deletions
+109 -29
View File
@@ -39,35 +39,115 @@ in {
boot.loader.systemd-boot.enable = mkDefault (!cfg.secureBoot);
}
(mkIf (cfg.laptop.homeRowMods) {
services.keyd = {
enable = true;
keyboards = {
internal = {
ids = ["0001:0001" "048d:c101"];
settings.main = let
# finger = mod;
pinky = "alt";
ring = "meta";
middle = "control";
index = "shift";
# timeouts
idle = "200";
hold = "150";
# function takes finger and letter
homeRowMod = f: l: "lettermod(${f}, ${l}, ${idle}, ${hold})";
in {
"a" = homeRowMod pinky "a";
"s" = homeRowMod ring "s";
"d" = homeRowMod middle "d";
"f" = homeRowMod index "f";
"j" = homeRowMod index "j";
"k" = homeRowMod middle "k";
"l" = homeRowMod ring "l";
";" = homeRowMod pinky ";";
};
};
};
};
services.kanata.keyboards.internal.config = ''
;; Kanata Configuration File for Graphite Anglemod Layout
;; Add a default configuration section to define unmapped key behavior.
(defcfg
process-unmapped-keys no ;; Ensure unmapped keys are passed to the OS unchanged.
)
;; Define the source keys Kanata will intercept.
(defsrc
grv 1 2 3 4 5 6 7 8 9 0 - = bspc
tab q w e r t y u i o p [ ] \
caps a s d f g h j k l ; ' ret
lsft z x c v b n m , . / rsft
lctl lmet lalt spc ralt rmet rctl
)
(defvar
tap-time 150
hold-time 200
)
;; Default QWERTY Layout
(deflayer qwerty
grv 1 2 3 4 5 6 7 8 9 0 - = bspc
tab q w e r t y u i o p [ ] \
caps a s d f g h j k l ; ' ret
lsft z x c v b n m , . / rsft
lctl lmet lalt spc ralt rmet rctl
)
(defalias
escctrl (tap-hold 100 100 esc lctl)
a (multi f24 (tap-hold $tap-time $hold-time a lalt))
s (multi f24 (tap-hold $tap-time $hold-time s lmet))
d (multi f24 (tap-hold $tap-time $hold-time d lctl))
f (multi f24 (tap-hold $tap-time $hold-time f lsft))
x (multi f24 (tap-hold $tap-time $hold-time x ralt))
j (multi f24 (tap-hold $tap-time $hold-time j lsft))
k (multi f24 (tap-hold $tap-time $hold-time k lctl))
l (multi f24 (tap-hold $tap-time $hold-time l lmet))
; (multi f24 (tap-hold $tap-time $hold-time ; lalt))
. (multi f24 (tap-hold $tap-time $hold-time . ralt))
)
;; QWERTY Layout with home row mods
(deflayer qwerty-home-mod
@grl 1 2 3 4 5 6 7 8 9 0 - = bspc
tab q w e r t y u i o p [ ] \
@esscctrl @a @s @d @f g h @j @k @l @; ' ret
lsft z @x c v b n m , @. / rsft
lctl lmet lalt spc ralt rmet rctl
)
(defalias
quote (fork ' S-- (lsft rsft)) ;; ' -> _
comma (fork , S-/ (lsft rsft)) ;; , -> ?
hyphen (fork - S-' (lsft rsft)) ;; - -> "
slash (fork / S-, (lsft rsft)) ;; / -> <
)
(defalias
n (multi f24 (tap-hold $tap-time $hold-time n lalt))
r (multi f24 (tap-hold $tap-time $hold-time r lmet))
t (multi f24 (tap-hold $tap-time $hold-time t lctl))
gs (multi f24 (tap-hold $tap-time $hold-time s lsft))
m (multi f24 (tap-hold $tap-time $hold-time m ralt))
h (multi f24 (tap-hold $tap-time $hold-time h lsft))
ga (multi f24 (tap-hold $tap-time $hold-time a lctl))
e (multi f24 (tap-hold $tap-time $hold-time e lmet))
i (multi f24 (tap-hold $tap-time $hold-time i lalt))
hyph (multi f24 (tap-hold $tap-time $hold-time @hyphen ralt))
)
;; Graphite Anglemod Layout
(deflayer graphite-anglemod
@grl 1 2 3 4 5 6 7 8 9 0 [ ] bspc
tab b l d w z @quote f o u j ; = \
@cap @n @r @t @gs g y @h @ga @e @i @comma ret
lsft x @m c v q p k . @hyph @slash rsft
lctl lmet lalt spc ralt rmet rctl
)
;; Define layer-switching aliases for clean deflayer declarations
(defalias
;; Tap: backtick (grave), Hold: toggles 'layers' for layer switching.
grl (tap-hold 200 200 grv (layer-toggle layers))
;; Layer-switch aliases
gar (layer-switch graphite-anglemod)
qwr (layer-switch qwerty)
qwm (layer-switch qwerty-home-mod)
;; Tap for Caps Lock, Hold for Ctrl
cap (tap-hold 200 200 caps lctl)
)
;; Layer-Switching Layer
;; Keys 1 and 2 switch between QWERTY and Graphite Anglemod layouts
;; The _ (underscore) indicates transparent behavior (passes through base layer).
(deflayer layers
_ @qwm @gar @qwr _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _
)
'';
})
(mkIf (cfg.powerSave) {
powerManagement.enable = true;