GNU bug report logs - #67738
xinitrc function in services/xorg.scm do not handle guix-home's direcory.

Previous Next

Package: guix;

Reported by: Feng Shu <tumashu <at> 163.com>

Date: Sun, 10 Dec 2023 06:39:02 UTC

Severity: normal

To reply to this bug, email your comments to 67738 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#67738; Package guix. (Sun, 10 Dec 2023 06:39:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Feng Shu <tumashu <at> 163.com>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Sun, 10 Dec 2023 06:39:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Feng Shu <tumashu <at> 163.com>
To: "guix-bug" <bug-guix <at> gnu.org>
Subject: xinitrc function in services/xorg.scm do not handle guix-home's
 direcory. 
Date: Sun, 10 Dec 2023 14:37:22 +0800


(define* (xinitrc #:key fallback-session)
  "Return a system-wide xinitrc script that starts the specified X session,
which should be passed to this script as the first argument.  If not, the
@var{fallback-session} will be used or, if @var{fallback-session} is false, a
desktop session from the system or user profile will be used."
  (define builder
    #~(begin
        (use-modules (ice-9 match)
                     (ice-9 regex)
                     (ice-9 ftw)
                     (ice-9 rdelim)
                     (srfi srfi-1)
                     (srfi srfi-26))
        ...

        (define system-profile
          "/run/current-system/profile")

        (define user-profile
          (and=> (getpw (getuid))
                 (lambda (pw)
                   (string-append (passwd:dir pw) "/.guix-profile"))))

        I think we should handle '.guix-home' direcory, just like .guix-profile.

        ...

        (let* ((home          (getenv "HOME"))
               (xsession-file (string-append home "/.xsession"))
               (session       (match (command-line)
                                ((_)
                                 #$(if fallback-session
                                       #~(list #$fallback-session)
                                       #f))
                                ((_ x ..1)
                                 x))))
          (if (file-exists? xsession-file)
              ;; Run ~/.xsession when it exists.
              (apply exec-from-login-shell xsession-file
                     (or session '()))
              ;; Otherwise, start the specified session or a fallback.
              (apply exec-from-login-shell
                     (or session
                         (find-session user-profile)
                         (find-session system-profile)))))))

  (program-file "xinitrc" builder))


-- 





Information forwarded to bug-guix <at> gnu.org:
bug#67738; Package guix. (Thu, 14 Dec 2023 03:08:02 GMT) Full text and rfc822 format available.

Message #8 received at 67738 <at> debbugs.gnu.org (full text, mbox):

From: Feng Shu <tumashu <at> 163.com>
To: 67738 <at> debbugs.gnu.org
Subject: [PATCH] services: xorg: Find sessions from guix home directory.
Date: Thu, 14 Dec 2023 10:58:02 +0800

From 19ca112441184a2c54a02ebbb6b84bca1c23dfea Mon Sep 17 00:00:00 2001

* gnu/services/xorg.scm (xinitrc): Find sessions from guix home directory.
---
 gnu/services/xorg.scm | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm
index f8cf9f25b6..9235295dd6 100644
--- a/gnu/services/xorg.scm
+++ b/gnu/services/xorg.scm
@@ -458,6 +458,11 @@ (define user-profile
                  (lambda (pw)
                    (string-append (passwd:dir pw) "/.guix-profile"))))
 
+        (define guix-home-profile
+          (and=> (getpw (getuid))
+                 (lambda (pw)
+                   (string-append (passwd:dir pw) "/.guix-home/profile"))))
+
         (define (xsession-command desktop-file)
           ;; Read from DESKTOP-FILE its X session command and return it as a
           ;; list.
@@ -503,6 +508,7 @@ (define (find-session profile)
               (apply exec-from-login-shell
                      (or session
                          (find-session user-profile)
+                         (find-session guix-home-profile)
                          (find-session system-profile)))))))
 
   (program-file "xinitrc" builder))
-- 
2.39.2


-- 





Information forwarded to bug-guix <at> gnu.org:
bug#67738; Package guix. (Fri, 15 Dec 2023 00:47:01 GMT) Full text and rfc822 format available.

Message #11 received at 67738 <at> debbugs.gnu.org (full text, mbox):

From: Feng Shu <tumashu <at> 163.com>
To: 67738 <at> debbugs.gnu.org
Subject: [PATCH v2] services: xorg: Find sessions from guix home directory.
Date: Fri, 15 Dec 2023 08:46:00 +0800
From 0e3968aff482ed8ef912f02b744631bb8899f9e4 Mon Sep 17 00:00:00 2001
From: Feng Shu <tumashu <at> 163.com>
Date: Thu, 14 Dec 2023 10:58:02 +0800
Subject: [PATCH v2] services: xorg: Find sessions from guix home directory.

* gnu/services/xorg.scm (xinitrc): Find sessions from guix home directory.
---
 gnu/services/xorg.scm | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm
index f8cf9f25b6..9235295dd6 100644
--- a/gnu/services/xorg.scm
+++ b/gnu/services/xorg.scm
@@ -458,6 +458,11 @@ (define user-profile
                  (lambda (pw)
                    (string-append (passwd:dir pw) "/.guix-profile"))))
 
+        (define guix-home-profile
+          (and=> (getpw (getuid))
+                 (lambda (pw)
+                   (string-append (passwd:dir pw) "/.guix-home/profile"))))
+
         (define (xsession-command desktop-file)
           ;; Read from DESKTOP-FILE its X session command and return it as a
           ;; list.
@@ -503,6 +508,7 @@ (define (find-session profile)
               (apply exec-from-login-shell
                      (or session
                          (find-session user-profile)
+                         (find-session guix-home-profile)
                          (find-session system-profile)))))))
 
   (program-file "xinitrc" builder))
-- 
2.39.2


-- 





This bug report was last modified 1 year and 183 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.