improved kmonad

This commit is contained in:
Ingolf Wagner 2023-06-02 16:40:40 +02:00
parent 951dff8dec
commit d4507b8176
No known key found for this signature in database
GPG key ID: 76BF5F1928B9618B

View file

@ -1,46 +1,63 @@
{ config, pkgs, ... }: { config, pkgs, lib, ... }:
{ {
services.xserver = {
layout = "us"; options.components.gui.kmonad.enable = lib.mkOption {
xkbOptions = "compose:ralt"; type = lib.types.bool;
default = config.components.gui.enable;
}; };
services.kmonad = {
enable = true;
keyboards.dasKeyboard = {
device = "/dev/input/by-id/usb-Metadot_-_Das_Keyboard_Das_Keyboard-event-kbd";
extraGroups = [ "video" ];
defcfg = {
enable = true;
fallthrough = true;
allowCommands = true;
};
config = ''
(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 cmp rctl
)
(defalias sym (layer-toggle symbols)) config = lib.mkIf (config.components.gui.kmonad.enable) {
(deflayer qwerty services.xserver = {
grv 1 2 3 4 5 6 7 8 9 0 - = bspc layout = "us";
tab q w e r t y u i o p [ ] \ xkbOptions = "compose:ralt";
esc a s d f g h j k l ; ' ret
lsft z x c v b n m , . / rsft
lctl lmet lalt spc @sym rmet cmp rctrl
)
(deflayer symbols
_ ½ ² ³ _ _ _
_ _ _ _ _ ü _ ö _ _ _ _
caps ä ß _ _ _ _ _ _ _ _ _ _
_ _ _ ¢ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _)
'';
}; };
services.kmonad = {
enable = true;
keyboards =
let
keyboard = device: {
device = device;
extraGroups = [ "video" ];
defcfg = {
enable = true;
fallthrough = true;
allowCommands = true;
};
config = ''
(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 cmp rctl
)
(defalias sym (layer-toggle symbols))
(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 [ ] \
esc a s d f g h j k l ; ' ret
lsft z x c v b n m , . / rsft
lctl lmet lalt spc @sym rmet cmp rctrl
)
(deflayer symbols
_ ½ ² ³ _ _ _
_ _ _ _ _ ü _ ö _ _ _ _
caps ä ß _ _ _ _ _ _ _ _ _ _
_ _ _ ¢ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _)
'';
};
in
{
nativ = keyboard "/dev/input/by-path/platform-i8042-serio-0-event-kbd";
dasKeyboard = keyboard "/dev/input/by-id/usb-Metadot_-_Das_Keyboard_Das_Keyboard-event-kbd";
};
};
}; };
} }