mirror of
https://github.com/nmasur/dotfiles
synced 2024-11-22 13:25:38 +00:00
switch from keyd to kanata
more reliable, doesn't break on update. also allows the escape key to timeout and turn into lctrl after 1 second, which might be nicer behavior
This commit is contained in:
parent
65aa25b213
commit
842f373101
@ -209,12 +209,6 @@
|
|||||||
label-foreground = config.theme.colors.base06;
|
label-foreground = config.theme.colors.base06;
|
||||||
# format-background = colors.background;
|
# format-background = colors.background;
|
||||||
};
|
};
|
||||||
"module/keyboard" = {
|
|
||||||
type = "custom/text";
|
|
||||||
content = "";
|
|
||||||
click-left = "doas systemctl restart keyd";
|
|
||||||
content-foreground = config.theme.colors.base04;
|
|
||||||
};
|
|
||||||
"module/power" = {
|
"module/power" = {
|
||||||
type = "custom/text";
|
type = "custom/text";
|
||||||
content = " ";
|
content = " ";
|
||||||
|
@ -1,9 +1,4 @@
|
|||||||
{
|
{ config, lib, ... }:
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
{
|
{
|
||||||
|
|
||||||
config = lib.mkIf config.physical {
|
config = lib.mkIf config.physical {
|
||||||
@ -17,24 +12,30 @@
|
|||||||
autoRepeatInterval = 40;
|
autoRepeatInterval = 40;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Use capslock as escape and/or control
|
# Swap Caps-Lock with Escape when pressed or LCtrl when held/combined with others
|
||||||
services.keyd = {
|
# Inspired by: https://www.youtube.com/watch?v=XuQVbZ0wENE
|
||||||
|
services.kanata = {
|
||||||
enable = true;
|
enable = true;
|
||||||
keyboards = {
|
keyboards.default = {
|
||||||
default = {
|
devices = [
|
||||||
ids = [ "*" ];
|
"/dev/input/by-id/usb-Logitech_Logitech_G710_Keyboard-event-kbd"
|
||||||
settings = {
|
"/dev/input/by-id/usb-Logitech_Logitech_G710_Keyboard-if01-event-kbd"
|
||||||
main = {
|
];
|
||||||
capslock = "overload(control, esc)";
|
extraDefCfg = "process-unmapped-keys yes";
|
||||||
};
|
config = ''
|
||||||
};
|
(defsrc
|
||||||
};
|
caps
|
||||||
|
)
|
||||||
|
(defalias
|
||||||
|
escctrl (tap-hold-press 1000 1000 esc lctrl)
|
||||||
|
)
|
||||||
|
(deflayer base
|
||||||
|
@escctrl
|
||||||
|
)
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# For some reason, keyd doesn't restart properly when updating
|
|
||||||
system.activationScripts.keyd.text = "${pkgs.systemd}/bin/systemctl restart keyd.service";
|
|
||||||
|
|
||||||
# Enable num lock on login
|
# Enable num lock on login
|
||||||
home-manager.users.${config.user}.xsession.numlock.enable = true;
|
home-manager.users.${config.user}.xsession.numlock.enable = true;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user