aboutsummaryrefslogtreecommitdiff
path: root/gnu/services
diff options
context:
space:
mode:
authorMorgan Smith <Morgan.J.Smith@outlook.com>2024-08-06 21:51:37 -0400
committerLudovic Courtès <ludo@gnu.org>2024-08-21 18:58:35 +0200
commit0b65a43cf8d0c190113461315ac62c1b1c367535 (patch)
treec170f0c11aed89bdc0f988940922a6d323941ee8 /gnu/services
parent410c85f40003dd1209822a930ff54e5ed90fb872 (diff)
downloadguix-0b65a43cf8d0c190113461315ac62c1b1c367535.tar
guix-0b65a43cf8d0c190113461315ac62c1b1c367535.tar.gz
services: elogind-configuration: Add more sleep configurations
* gnu/services/desktop.scm (<elogind-configuration>): Allow actions to be set to 'suspend-then-hibernate'. Add configuration for 'hibernate-delay-seconds' and 'suspend-estimation-seconds'. * doc/guix.texi (Desktop Services): Add documentation for 'hibernate-delay-seconds' and 'suspend-estimation-seconds'. Change-Id: Icf788fcc88451aa6174a608fbed309961b847430 Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'gnu/services')
-rw-r--r--gnu/services/desktop.scm15
1 files changed, 12 insertions, 3 deletions
diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm
index 63e2011ce3..9c4d2a1822 100644
--- a/gnu/services/desktop.scm
+++ b/gnu/services/desktop.scm
@@ -1080,7 +1080,11 @@ and many other) available for GIO applications.")
(default '("disk")))
(hybrid-sleep-mode elogind-hybrid-sleep-mode
(default
- '("suspend" "platform" "shutdown"))))
+ '("suspend" "platform" "shutdown")))
+ (hibernate-delay-seconds elogind-hibernate-delay-seconds
+ (default *unspecified*))
+ (suspend-estimation-seconds elogind-suspend-estimation-seconds
+ (default *unspecified*)))
(define (elogind-configuration-file config)
(define (yesno x)
@@ -1104,8 +1108,11 @@ and many other) available for GIO applications.")
(unless (exact-integer? x) (error "not an integer" x))
(when (negative? x) (error "negative number not allowed" x))
(number->string x))
+ (define (maybe-non-negative-integer x)
+ (or (and (unspecified? x) x)
+ (non-negative-integer x)))
(define handle-actions
- '(ignore poweroff reboot halt kexec suspend hibernate hybrid-sleep lock))
+ '(ignore poweroff reboot halt kexec suspend hibernate hybrid-sleep suspend-then-hibernate lock))
(define (handle-action x)
(if (unspecified? x)
x ;let the unspecified value go through
@@ -1163,7 +1170,9 @@ and many other) available for GIO applications.")
("HibernateState" (sleep-list elogind-hibernate-state))
("HibernateMode" (sleep-list elogind-hibernate-mode))
("HybridSleepState" (sleep-list elogind-hybrid-sleep-state))
- ("HybridSleepMode" (sleep-list elogind-hybrid-sleep-mode))))
+ ("HybridSleepMode" (sleep-list elogind-hybrid-sleep-mode))
+ ("HibernateDelaySec" (maybe-non-negative-integer elogind-hibernate-delay-seconds))
+ ("SuspendEstimationSec" (maybe-non-negative-integer elogind-suspend-estimation-seconds))))
(define (elogind-dbus-service config)
"Return a @file{org.freedesktop.login1.service} file that tells D-Bus how to