From: Fabio Natali via Guix-patches via <guix-patches@gnu.org>
To: 73788@debbugs.gnu.org
Cc: "Fabio Natali" <me@fabionatali.com>
Subject: [bug#73788] [PATCH] home: services: Fix 'home-unclutter-service-type'.
Date: Sun, 13 Oct 2024 12:45:29 +0100 [thread overview]
Message-ID: <b337f523b187d7ac4809eb5efc9b7da94d42f064.1728818409.git.me@fabionatali.com> (raw)
* gnu/home/services/desktop.scm: Add DISPLAY to the list of environment
variables passed to 'home-unclutter-service-type'. Change
'make-forkexec-construstor' to 'fork+exec-command' as the former did not seem to
pick up the newly defined environment variable. Add 'x11-display' as a
requirement. These changes are consistent to how things are done in
'home-redshift-service-type'.
Change-Id: Ie8b88b30353e76139d354da27aef791036eaa5a0
---
Hi All. 👋
This is to fix an issue with 'home-unclutter-service-type' where the 'DISPLAY'
environment variable was not passed to the service. Without this patch, on my
system the service fails reporting the following error message in the logs:
'unclutter: could not open display'.
This patch mirrors how things are handled in the 'home-redshift-service-type'
service, so hopefully it's fine.
Let me know what you think.
Thanks, cheers, Fabio.
gnu/home/services/desktop.scm | 38 ++++++++++++++++++++++-------------
1 file changed, 24 insertions(+), 14 deletions(-)
diff --git a/gnu/home/services/desktop.scm b/gnu/home/services/desktop.scm
index 679ba31c0f..dc9de168b7 100644
--- a/gnu/home/services/desktop.scm
+++ b/gnu/home/services/desktop.scm
@@ -349,21 +349,31 @@ (define (home-unclutter-shepherd-service config)
(list
(shepherd-service
(provision '(unclutter))
- (requirement '())
+ ;; Depend on 'x11-display', which sets 'DISPLAY' if an X11 server is
+ ;; available, and fails to start otherwise.
+ (requirement '(x11-display))
+ (modules '((srfi srfi-1)
+ (srfi srfi-26)))
(one-shot? #t)
- (start #~(make-forkexec-constructor
- (list
- #$(file-append
- (home-unclutter-configuration-unclutter config)
- "/bin/unclutter")
- "-idle"
- (number->string
- #$(home-unclutter-configuration-idle-timeout config)))
- #:log-file (string-append
- (or (getenv "XDG_STATE_HOME")
- (format #f "~a/.local/state"
- (getenv "HOME")))
- "/log/unclutter.log"))))))
+ (start #~(lambda _
+ (fork+exec-command
+ (list
+ #$(file-append
+ (home-unclutter-configuration-unclutter config)
+ "/bin/unclutter")
+ "-idle"
+ (number->string
+ #$(home-unclutter-configuration-idle-timeout config)))
+ ;; Inherit the 'DISPLAY' variable set by 'x11-display'.
+ #:environment-variables
+ (cons (string-append "DISPLAY=" (getenv "DISPLAY"))
+ (remove (cut string-prefix? "DISPLAY=" <>)
+ (default-environment-variables)))
+ #:log-file (string-append
+ (or (getenv "XDG_STATE_HOME")
+ (format #f "~a/.local/state"
+ (getenv "HOME")))
+ "/log/unclutter.log")))))))
(define home-unclutter-service-type
(service-type
base-commit: e4f5eb6c01727ef143e533019e74830e00d6f5d2
--
2.46.0
next reply other threads:[~2024-10-13 11:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-13 11:45 Fabio Natali via Guix-patches via [this message]
2024-10-14 12:06 ` bug#73788: [PATCH] home: services: Fix 'home-unclutter-service-type' Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b337f523b187d7ac4809eb5efc9b7da94d42f064.1728818409.git.me@fabionatali.com \
--to=guix-patches@gnu.org \
--cc=73788@debbugs.gnu.org \
--cc=me@fabionatali.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).