Reworked directory structure, changed aroundthings here and there in Kanata conf.kbd, Emacs init.el, and common.nix (added direnv)
This commit is contained in:
parent
f3f8da5fdf
commit
507b016a03
25 changed files with 52 additions and 118 deletions
157
modules/kanata/conf.kbd
Normal file
157
modules/kanata/conf.kbd
Normal file
|
|
@ -0,0 +1,157 @@
|
|||
#|
|
||||
Kanata Config
|
||||
○ Ergonomic (kinda?) 34-key QWERTY layout
|
||||
○ GACS home-row mods
|
||||
○ Layers for function, number, media, and symbol keys
|
||||
○ Dedicated (and non-intrusive!) standard layout toggle for reliant tasks
|
||||
○ Decently commented for beginners and seasoned veterans alike.
|
||||
|
||||
FEEL FREE TO FORK!!!
|
||||
|#
|
||||
(defcfg
|
||||
process-unmapped-keys yes
|
||||
block-unmapped-keys yes
|
||||
concurrent-tap-hold yes
|
||||
movemouse-smooth-diagonals yes
|
||||
)
|
||||
|
||||
(defsrc
|
||||
caps
|
||||
q w e r t y u i o p
|
||||
a s d f g h j k l scln
|
||||
z x c v b n m , . /
|
||||
lalt spc ralt
|
||||
)
|
||||
|
||||
(defvar
|
||||
tap-time 200
|
||||
hold-time 250
|
||||
chord-time 50
|
||||
)
|
||||
|
||||
(defalias
|
||||
;; Normal keyboard layer for gaming/other normie usage
|
||||
normie (layer-switch norm)
|
||||
;; Key chord definitions
|
||||
chw (chord ch w)
|
||||
che (chord ch e)
|
||||
chi (chord ch i)
|
||||
cho (chord ch o)
|
||||
chs (chord ch s)
|
||||
chd (chord ch d)
|
||||
chf (chord ch f)
|
||||
chj (chord ch j)
|
||||
chk (chord ch k)
|
||||
chl (chord ch l)
|
||||
ch_lalt (chord ch lalt)
|
||||
ch_ralt (chord ch ralt)
|
||||
;; Hyper and Meh Aliases
|
||||
hyper (multi lmet lsft lctl lalt)
|
||||
meh (multi lsft lctl lalt)
|
||||
;; Remap Caps to Escape/Nav layer
|
||||
navlayer (layer-while-held nav)
|
||||
caps (tap-hold $tap-time $hold-time (tap-dance 200 (lctl @hyper caps)) @navlayer)
|
||||
;; Home row mods
|
||||
a (tap-hold $tap-time $hold-time a lmet)
|
||||
s (tap-hold $tap-time $hold-time s lalt)
|
||||
d (tap-hold $tap-time $hold-time d lctl)
|
||||
f (tap-hold $tap-time $hold-time f lsft)
|
||||
j (tap-hold $tap-time $hold-time j rsft)
|
||||
k (tap-hold $tap-time $hold-time k lctl)
|
||||
l (tap-hold $tap-time $hold-time l lalt)
|
||||
scln (tap-hold $tap-time $hold-time scln rmet)
|
||||
|
||||
numpad (layer-while-held num)
|
||||
g (tap-hold $tap-time $hold-time g @numpad)
|
||||
|
||||
fnkeys (layer-while-held fn)
|
||||
h (tap-hold $tap-time $hold-time h @fnkeys)
|
||||
|
||||
v (tap-hold $tap-time $hold-time v @meh)
|
||||
m (tap-hold $tap-time $hold-time m (multi lsft lctl lalt))
|
||||
|
||||
symbols (layer-while-held symbol)
|
||||
spc (tap-hold $tap-time $hold-time spc @symbols)
|
||||
|
||||
medialy (layer-while-held md)
|
||||
z (tap-hold $tap-time $hold-time z @medialy)
|
||||
/ (tap-hold $tap-time $hold-time / @medialy)
|
||||
)
|
||||
;; Chord definitions. Kind of weird to read as a layperson
|
||||
;; so I provided sufficient comments for general understanding.
|
||||
(defchords ch $chord-time
|
||||
(w ) w
|
||||
( e) e
|
||||
(w e) XX
|
||||
(i ) i
|
||||
( o) o
|
||||
(i o) XX
|
||||
(s ) @s
|
||||
( d) @d
|
||||
(s d) tab
|
||||
(f ) @f
|
||||
(f d) tab
|
||||
(j k) esc
|
||||
(k ) @k
|
||||
( l) @l
|
||||
(k l) ret
|
||||
(lalt ) (tap-dance $tap-time ((multi lsft lctl lalt lmet) lalt))
|
||||
( ralt) (tap-dance $tap-time ((multi lsft lctl lalt lmet) lalt))
|
||||
(lalt ralt) (tap-hold $tap-time $hold-time @normie (layer-switch base))
|
||||
)
|
||||
|
||||
(deflayer base
|
||||
@caps
|
||||
q @chw @che r t y u @chi @cho p
|
||||
@a @chs @chd @chf @g @h @chj @chk @chl @scln
|
||||
@z x c @v b n @m , . @/
|
||||
@ch_lalt @spc @ch_ralt
|
||||
)
|
||||
|
||||
(deflayer nav
|
||||
_
|
||||
mbck (movemouse-up 3 3) mfwd _ _ _ mlft mrgt pgup pgdn
|
||||
(movemouse-left 3 3) (movemouse-down 3 3) (movemouse-right 3 3) _ home left down up right end
|
||||
_ _ _ _ _ _ _ _ _ _
|
||||
_ _ _
|
||||
)
|
||||
|
||||
(deflayer num
|
||||
_
|
||||
_ _ _ _ _ _ 7 8 9 _
|
||||
_ _ _ _ _ _ 4 5 6 0 _
|
||||
_ _ _ _ _ 1 2 3 _
|
||||
_ _ _
|
||||
)
|
||||
|
||||
(deflayer fn
|
||||
_
|
||||
f1 f2 f3 f4 _ _ _ _ _ _
|
||||
f5 f6 f7 f8 _ _ _ _ _ _ _
|
||||
f9 f10 f11 f12 _ _ _ _ _
|
||||
_ _ _
|
||||
)
|
||||
|
||||
(deflayer symbol
|
||||
_
|
||||
S-1 S-2 S-3 S-4 S-5 S-6 S-7 S-8 S-9 S-0
|
||||
S-\ = - S-= S-- ` S-` S-scln ' S-'
|
||||
_ \ S-[ S-] S-, S-. [ ] _ _
|
||||
_ _ _
|
||||
)
|
||||
|
||||
(deflayer norm
|
||||
esc
|
||||
q w e r t y u i o p
|
||||
a s d f g h j k l scln
|
||||
z x c v b n m , . /
|
||||
@ch_lalt spc @ch_ralt
|
||||
)
|
||||
|
||||
(deflayer md
|
||||
_
|
||||
_ _ _ _ _ _ _ _ _ _
|
||||
prev pp next mute _ _ vold volu brdn brup
|
||||
_ _ _ _ _ _ _ _ _ _
|
||||
_ _ _
|
||||
)
|
||||
32
modules/kanata/kanata.nix
Normal file
32
modules/kanata/kanata.nix
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
{ config, libs, pkgs, inputs, ... }:
|
||||
|
||||
{
|
||||
# Kanata setup
|
||||
# Mostly copied from https://dev.to/shanu-kumawat/how-to-set-up-kanata-on-nixos-a-step-by-step-guide-1jkc
|
||||
boot.kernelModules = [ "uinput" ]; # Enable uinput kernel module
|
||||
hardware.uinput.enable = true; # Enable uinput
|
||||
# Set up udev rules for uinput
|
||||
services.udev.extraRules = ''
|
||||
KERNEL=="uinput", MODE="0660", GROUP="uinput", OPTIONS+="static_node=uinput"
|
||||
'';
|
||||
users.groups.uinput = { }; # ensure uinput group exists
|
||||
# Add Kanata service user to necessary groups
|
||||
systemd.services.kanata-internalKeyboard.serviceConfig = {
|
||||
SupplementaryGroups = [
|
||||
"input"
|
||||
"uinput"
|
||||
];
|
||||
};
|
||||
# Kanata configuration
|
||||
services.kanata = {
|
||||
enable = true;
|
||||
keyboards = {
|
||||
internalKeyboard = {
|
||||
devices = [
|
||||
"/dev/input/by-path/platform-i8042-serio-0-event-kbd"
|
||||
];
|
||||
configFile = ./conf.kbd;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue