Add Kanata to manage keyboard layout
This commit is contained in:
parent
eff95c59f4
commit
55df110124
3 changed files with 75 additions and 11 deletions
|
@ -49,7 +49,12 @@
|
|||
};
|
||||
fonts.enable = true;
|
||||
gnome.enable = true;
|
||||
# greetd.enable = true;
|
||||
kanata = {
|
||||
enable = true;
|
||||
devices = [
|
||||
"/dev/input/by-id/usb-04d9_USB-HID_Keyboard-event-kbd"
|
||||
];
|
||||
};
|
||||
lightdm.enable = true;
|
||||
networking.enable = true;
|
||||
nix-common = {
|
||||
|
|
59
modules/kanata/default.nix
Normal file
59
modules/kanata/default.nix
Normal file
|
@ -0,0 +1,59 @@
|
|||
{ config, lib, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.eboskma.kanata;
|
||||
in
|
||||
{
|
||||
options.eboskma.kanata = {
|
||||
enable = mkEnableOption "kanata";
|
||||
devices = mkOption {
|
||||
description = "Devices to enable kanata for";
|
||||
type = types.listOf types.path;
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.kanata = {
|
||||
enable = true;
|
||||
|
||||
keyboards = {
|
||||
ducky = {
|
||||
devices = cfg.devices;
|
||||
|
||||
config = ''
|
||||
(defsrc
|
||||
esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 prtsc scrlck pp calc mute voldwn volu
|
||||
grv 1 2 3 4 5 6 7 8 9 0 - = bspc ins home pgup nlck kp/ kp* kp-
|
||||
tab q w e r t y u i o p [ ] \ del end pgdn kp7 kp8 kp9 kp+
|
||||
caps a s d f g h j k l ; ' ret kp4 kp5 kp6
|
||||
lsft z x c v b n m , . / rsft up kp1 kp2 kp3 kprt
|
||||
lctl lmet lalt spc ralt rmet rctl lft down rght kp0 kp.)
|
||||
|
||||
(deflayer colemak
|
||||
esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 prtsc @qwe pp calc mute voldwn volu
|
||||
grv 1 2 3 4 5 6 7 8 9 0 - = bspc ins home pgup nlck kp/ kp* kp-
|
||||
tab q w f p g j l u y ; [ ] \ del end pgdn kp7 kp8 kp9 kp+
|
||||
@cap a r s t d h n e i o ' ret kp4 kp5 kp6
|
||||
lsft z x c v b k m , . / rsft up kp1 kp2 kp3 kprt
|
||||
lctl lmet lalt spc ralt rmet rctl lft down rght kp0 kp.)
|
||||
|
||||
(deflayer qwerty
|
||||
esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 prtsc @col pp calc mute voldwn volu
|
||||
grv 1 2 3 4 5 6 7 8 9 0 - = bspc ins home pgup nlck kp/ kp* kp-
|
||||
tab q w e r t y u i o p [ ] \ del end pgdn kp7 kp8 kp9 kp+
|
||||
@cap a s d f g h j k l ; ' ret kp4 kp5 kp6
|
||||
lsft z x c v b n m , . / rsft up kp1 kp2 kp3 kprt
|
||||
lctl lmet lalt spc ralt rmet rctl lft down rght kp0 kp.)
|
||||
|
||||
(defalias
|
||||
cap (tap-hold 100 100 bspc lctl)
|
||||
col (layer-switch colemak)
|
||||
qwe (layer-switch qwerty)
|
||||
)
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
}
|
|
@ -93,12 +93,12 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
home.keyboard = {
|
||||
layout = "us,us";
|
||||
variant = "colemak,";
|
||||
model = "pc105";
|
||||
options = [ "ctrl:nocaps" "eurosign:5" "lv5:ralt_switch" "lv3:rwin_switch" "grp:sclk_toggle" "grp_led:scroll" ];
|
||||
};
|
||||
# home.keyboard = {
|
||||
# layout = "us,us";
|
||||
# variant = "colemak,";
|
||||
# model = "pc105";
|
||||
# options = [ "ctrl:nocaps" "eurosign:5" "lv5:ralt_switch" "lv3:rwin_switch" "grp:sclk_toggle" "grp_led:scroll" ];
|
||||
# };
|
||||
|
||||
home.packages = with pkgs; [
|
||||
atool
|
||||
|
@ -229,10 +229,10 @@ in
|
|||
];
|
||||
|
||||
services.xserver = {
|
||||
layout = "us,us";
|
||||
xkbVariant = "colemak,";
|
||||
xkbModel = "pc105";
|
||||
xkbOptions = "ctrl:nocaps,eurosign:5,lv5:ralt_switch,lv3:rwin_switch,grp:shifts_toggle";
|
||||
# layout = "us,us";
|
||||
# xkbVariant = "colemak,";
|
||||
# xkbModel = "pc105";
|
||||
# xkbOptions = "ctrl:nocaps,eurosign:5,lv5:ralt_switch,lv3:rwin_switch,grp:shifts_toggle";
|
||||
upscaleDefaultCursor = false;
|
||||
exportConfiguration = true;
|
||||
|
||||
|
|
Loading…
Reference in a new issue