From 510ddfe9d7b9bd23482581d06c8ae053e85745ef Mon Sep 17 00:00:00 2001 From: Donovan Glover Date: Wed, 19 Jun 2024 02:02:43 -0400 Subject: [PATCH] hardware: Add phone support This is untested but should work. --- modules/hardware.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/hardware.nix b/modules/hardware.nix index fb6ef64d..72e68363 100644 --- a/modules/hardware.nix +++ b/modules/hardware.nix @@ -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 = {