* bug#67738: xinitrc function in services/xorg.scm do not handle guix-home's direcory.
@ 2023-12-10 6:37 Feng Shu
2023-12-14 2:58 ` bug#67738: [PATCH] services: xorg: Find sessions from guix home directory Feng Shu
2023-12-15 0:46 ` bug#67738: [PATCH v2] " Feng Shu
0 siblings, 2 replies; 3+ messages in thread
From: Feng Shu @ 2023-12-10 6:37 UTC (permalink / raw)
To: 67738
(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))
--
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#67738: [PATCH] services: xorg: Find sessions from guix home directory.
2023-12-10 6:37 bug#67738: xinitrc function in services/xorg.scm do not handle guix-home's direcory Feng Shu
@ 2023-12-14 2:58 ` Feng Shu
2023-12-15 0:46 ` bug#67738: [PATCH v2] " Feng Shu
1 sibling, 0 replies; 3+ messages in thread
From: Feng Shu @ 2023-12-14 2:58 UTC (permalink / raw)
To: 67738
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
--
^ permalink raw reply related [flat|nested] 3+ messages in thread
* bug#67738: [PATCH v2] services: xorg: Find sessions from guix home directory.
2023-12-10 6:37 bug#67738: xinitrc function in services/xorg.scm do not handle guix-home's direcory Feng Shu
2023-12-14 2:58 ` bug#67738: [PATCH] services: xorg: Find sessions from guix home directory Feng Shu
@ 2023-12-15 0:46 ` Feng Shu
1 sibling, 0 replies; 3+ messages in thread
From: Feng Shu @ 2023-12-15 0:46 UTC (permalink / raw)
To: 67738
From 0e3968aff482ed8ef912f02b744631bb8899f9e4 Mon Sep 17 00:00:00 2001
From: Feng Shu <tumashu@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
--
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-12-15 0:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-10 6:37 bug#67738: xinitrc function in services/xorg.scm do not handle guix-home's direcory Feng Shu
2023-12-14 2:58 ` bug#67738: [PATCH] services: xorg: Find sessions from guix home directory Feng Shu
2023-12-15 0:46 ` bug#67738: [PATCH v2] " Feng Shu
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).