feat(keyboard): add enable option
This commit is contained in:
@@ -1,19 +1,28 @@
|
|||||||
{ pkgs, ... }:
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
with pkgs;
|
|
||||||
let
|
let
|
||||||
tools = interception-tools;
|
cfg = config.keyboard;
|
||||||
inherit (interception-tools-plugins) caps2esc;
|
tools = pkgs.interception-tools;
|
||||||
|
inherit (pkgs.interception-tools-plugins) caps2esc;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
services.interception-tools = {
|
options.keyboard.enable = lib.mkEnableOption "keyboard remapping";
|
||||||
enable = true;
|
|
||||||
plugins = [ caps2esc ];
|
config = lib.mkIf cfg.enable {
|
||||||
udevmonConfig = ''
|
services.interception-tools = {
|
||||||
- JOB: ${tools}/bin/intercept -g $DEVNODE | ${caps2esc}/bin/caps2esc -m 1 | ${tools}/bin/uinput -d $DEVNODE
|
enable = true;
|
||||||
DEVICE:
|
plugins = [ caps2esc ];
|
||||||
EVENTS:
|
udevmonConfig = ''
|
||||||
EV_KEY: [KEY_CAPSLOCK]
|
- JOB: ${tools}/bin/intercept -g $DEVNODE | ${caps2esc}/bin/caps2esc -m 1 | ${tools}/bin/uinput -d $DEVNODE
|
||||||
'';
|
DEVICE:
|
||||||
|
EVENTS:
|
||||||
|
EV_KEY: [KEY_CAPSLOCK]
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user