I realize it's been almost a year since the last post, but this has been bothering me for the past few hours and I think I came to a conclusion about how this works.
As the /etc/xdg folder is actually a system-wide equivalent of ~/.config. It can be seen in the /usr/bin/startxfce4 file that the path /etc/xdg is exported to the enviroment variable $XDG_CONFIG_DIRS.
The problem which I had was I didn't know which xfce4-session.xml file should I change to use compiz instead of xfwm4. I had two xfce4-session.xml files:
Code:
/etc/xdg/xdg-xubuntu/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml
/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml
As I used the xfce.desktop session instead of the xubuntu.desktop (located in /usr/share/xsessions), my $XDG_CONFIG_DIR variable was:
Code:
XDG_CONFIG_DIRS="/etc/xdg/xdg-xfce:/etc/xdg:/etc/xdg"
Which means it will first look in the /etc/xdg/xdg-xfce folder to look for configuration and then will use the /etc/xdg as a fallback. As I do not have the xdg-xfce folder, the xfce4 configuration from /etc/xdg/xfce4 is used.
What bothered me was that I wanted to know where did that /etc/xdg/xdg-xfce value come from. A quick grep resulted in this:
Code:
$ grep -rIsnE XDG_CONFIG_DIRS=.*?xdg- /etc/*
/etc/X11/Xsession.d/60x11-common_xdg_path:11: XDG_CONFIG_DIRS="$DEFAULT_XDG_CONFIG_DIRS"/xdg-"$DESKTOP_SESSION":"$XDG_CONFIG_DIRS"
The $DEFAULT_XDG_CONFIG_DIRS is set to /etc/xdg in the same file on line 4.
This helped me to realize that the $DESKTOP_SESSION variable was to blame, so I did an another grep:
Code:
$ grep -rIsnE DESKTOP_SESSION= /etc/*
/etc/xdg/xfce4/xinitrc:21: DESKTOP_SESSION="xfce"
These are the lines around that very line:
Code:
# set DESKTOP_SESSION so that one can detect easily if an Xfce session is running
if test "x$DESKTOP_SESSION" = "x"; then
DESKTOP_SESSION="xfce"
export DESKTOP_SESSION
fi
The /etc/xdg/xfce4/xinitrc file is actually called from both xfce.desktop and xubuntu.desktop as they both call startxfce4 and startxfce4 calls xinitrc.
My guess was that the display manager such as lightdm sets both the $GDMSESSION and the $DESKTOP_SESSION enviroment variables (as they were both set to xfce) from the name of the xsession *.desktop file used for login. Then I downloaded the source code of lightdm to check for sure and an another grep showed that my guess was right:
Code:
$ apt-get source ligthtdm
$ cd lightdm-1.6.0
$ grep -rIsnE GDMSESSION\|DESKTOP_SESSION *
NEWS:598: * Set PATH, DESKTOP_SESSION, GDMSESSION and USERNAME environment variables
src/display.c:732: session_set_env (display->priv->session, "DESKTOP_SESSION", display->priv->user_session); // FIXME: Apparently deprecated?
src/display.c:733: session_set_env (display->priv->session, "GDMSESSION", display->priv->user_session); // FIXME: Not cross-desktop
Luckily I did not have to look futher into the code as the NEWS file had this documented.
I hope this post helps somebody in the future!
Bookmarks