From b382b59faf717c5b36f4cd8e1c5d96cdabd382c9 Mon Sep 17 00:00:00 2001 From: Filippo Berto Date: Wed, 24 Aug 2022 21:56:45 +0200 Subject: [PATCH] service.xidlehook: add detect-sleep option (#3165) Add detect sleep configuration option. Allows to execute the specified commands with more accurate timings if the system wakes from a sleep state. --- .github/CODEOWNERS | 2 +- modules/lib/maintainers.nix | 6 ++++++ modules/services/xidlehook.nix | 6 +++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 433e69aeb..9979fa816 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -490,7 +490,7 @@ Makefile @thiagokokada /modules/services/xembed-sni-proxy.nix @rycee -/modules/services/xidlehook.nix @dschrempf +/modules/services/xidlehook.nix @dschrempf @bertof /modules/services/xscreensaver.nix @rycee diff --git a/modules/lib/maintainers.nix b/modules/lib/maintainers.nix index 81f6e417c..a5d999576 100644 --- a/modules/lib/maintainers.nix +++ b/modules/lib/maintainers.nix @@ -25,6 +25,12 @@ github = "blmhemu"; githubId = 19410501; }; + bertof = { + name = "bertof"; + email = "berto.f@protonmail.com"; + github = "bertof"; + githubId = 9915675; + }; CarlosLoboxyz = { name = "Carlos Lobo"; email = "86011416+CarlosLoboxyz@users.noreply.github.com"; diff --git a/modules/services/xidlehook.nix b/modules/services/xidlehook.nix index f29250475..d769ccafb 100644 --- a/modules/services/xidlehook.nix +++ b/modules/services/xidlehook.nix @@ -23,13 +23,14 @@ let ${concatStringsSep " " (notEmpty [ "${cfg.package}/bin/xidlehook" (optionalString cfg.once "--once") + (optionalString cfg.detect-sleep "--detect-sleep") (optionalString cfg.not-when-fullscreen "--not-when-fullscreen") (optionalString cfg.not-when-audio "--not-when-audio") timers ])} ''; in { - meta.maintainers = [ maintainers.dschrempf ]; + meta.maintainers = [ maintainers.dschrempf hm.maintainers.bertof ]; options.services.xidlehook = { enable = mkEnableOption "xidlehook systemd service"; @@ -55,6 +56,9 @@ in { ''; }; + detect-sleep = mkEnableOption + "detecting when the system wakes up from a suspended state and resetting the idle timer"; + not-when-fullscreen = mkOption { type = types.bool; default = false;