unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#56050] [PATCH] home: services: environment-variables: Fix XDG base directories.
@ 2022-06-18  5:25 Philip McGrath
  2022-06-22 20:38 ` Ludovic Courtès
  0 siblings, 1 reply; 13+ messages in thread
From: Philip McGrath @ 2022-06-18  5:25 UTC (permalink / raw)
  To: 56050; +Cc: Philip McGrath

When the environment initialization script is run, XDG_DATA_DIRS and/or
XDG_CONFIG_DIRS may be empty or unset, in which case we must use their
respective defaults from the specification, rather than ending the value
with a trailing ":". For further discussion, see
<https://lists.gnu.org/archive/html/help-guix/2022-05/msg00147.html>.

* gnu/home/services.scm
(environment-variables->setup-environment-script): Use conditional
parameter expansion for XDG_DATA_DIRS and XDG_CONFIG_DIRS.
---

MANPATH and INFOPATH don't have this problem because they have
well-defined behavior for a trailing ":".

XCURSOR_PATH, on the other hand, does seem to have a similar problem. In
my KDE Plasma Wayland session, at least, omiting the default caused the
cursor to disappear when hovering over the border of a window. I could
fix this on my Debian-based distribution by putting:

    export XCURSOR_PATH="${XCURSOR_PATH:-/usr/share/icons:/usr/share/pixmaps}"

in a file under "/etc/profile.d", but I'm not sure if that default is
truly portable even among FHS-based distros. For example, it sounds like
Gentoo uses "/usr/share/cursors/xorg-x11". So I haven't tried to address
XCURSOR_PATH for now.

  -Philip

 gnu/home/services.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/home/services.scm b/gnu/home/services.scm
index 5ee3357792..ba14d8a119 100644
--- a/gnu/home/services.scm
+++ b/gnu/home/services.scm
@@ -208,7 +208,7 @@ (define (environment-variables->setup-environment-script vars)
 
 case $XDG_DATA_DIRS in
   *$HOME_ENVIRONMENT/profile/share*) ;;
-  *) export XDG_DATA_DIRS=$HOME_ENVIRONMENT/profile/share:$XDG_DATA_DIRS ;;
+  *) export XDG_DATA_DIRS=$HOME_ENVIRONMENT/profile/share:${XDG_DATA_DIRS:-/usr/local/share/:/usr/share/} ;;
 esac
 case $MANPATH in
   *$HOME_ENVIRONMENT/profile/share/man*) ;;
@@ -220,7 +220,7 @@ (define (environment-variables->setup-environment-script vars)
 esac
 case $XDG_CONFIG_DIRS in
   *$HOME_ENVIRONMENT/profile/etc/xdg*) ;;
-  *) export XDG_CONFIG_DIRS=$HOME_ENVIRONMENT/profile/etc/xdg:$XDG_CONFIG_DIRS ;;
+  *) export XDG_CONFIG_DIRS=$HOME_ENVIRONMENT/profile/etc/xdg:${XDG_CONFIG_DIRS:-/etc/xdg} ;;
 esac
 case $XCURSOR_PATH in
   *$HOME_ENVIRONMENT/profile/share/icons*) ;;

base-commit: 3154b582567539d8d607344fbd03a3d8456f66cb
-- 
2.32.0





^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2022-07-12  7:04 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-18  5:25 [bug#56050] [PATCH] home: services: environment-variables: Fix XDG base directories Philip McGrath
2022-06-22 20:38 ` Ludovic Courtès
2022-06-23 21:33   ` Philip McGrath
2022-06-25 21:39     ` Ludovic Courtès
2022-07-04  2:35       ` [bug#56050] [PATCH v2 0/2] etc/guix-install.sh: Initialize " Philip McGrath
2022-07-04  2:35         ` [bug#56050] [PATCH v2 1/2] " Philip McGrath
2022-07-04  9:11           ` Ludovic Courtès
2022-07-04 16:36             ` Philip McGrath
2022-07-04 21:01               ` Ludovic Courtès
2022-07-04 20:18           ` [bug#56050] [PATCH] home: services: environment-variables: Fix " Ludovic Courtès
2022-07-04  2:35         ` [bug#56050] [PATCH v2 2/2] etc/guix-install.sh: Check for profile from 'guix home' Philip McGrath
2022-07-04  9:13           ` Ludovic Courtès
2022-07-12  6:44           ` Andrew Tropin

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).