all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* 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

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 external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.