hardware: Add phone support

This is untested but should work.
This commit is contained in:
Donovan Glover 2024-06-19 02:02:43 -04:00
parent 6ff271d4e2
commit 510ddfe9d7
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65

View File

@ -4,7 +4,7 @@ let
inherit (lib) mkEnableOption mkIf getExe singleton;
inherit (pkgs) piper interception-tools;
inherit (pkgs.interception-tools-plugins) dual-function-keys;
inherit (cfg) mouseSettings disableLaptopKeyboard lidIgnore powerIgnore keyboardBinds bluetooth;
inherit (cfg) mouseSettings disableLaptopKeyboard lidIgnore powerIgnore keyboardBinds bluetooth phone;
inherit (builtins) toJSON;
dualFunctionKeysConfig = "dual-function-keys.yaml";
@ -19,6 +19,7 @@ in
disableLaptopKeyboard = mkEnableOption "udev rule to disable laptop keyboard";
lidIgnore = mkEnableOption "ignoring the laptop lid on close";
powerIgnore = mkEnableOption "ignoring the power button on press";
phone = mkEnableOption "Phone support";
};
config = {
@ -35,6 +36,8 @@ in
logind = {
lidSwitch = mkIf lidIgnore "ignore";
extraConfig = mkIf powerIgnore "HandlePowerKey=ignore";
powerKey = mkIf phone "suspend";
powerKeyLongPress = mkIf phone "poweroff";
};
interception-tools = {