Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 439692 - x11-apps/xinit: DESKTOP_SESSION variable empty when using XSESSION with 'startx'
Summary: x11-apps/xinit: DESKTOP_SESSION variable empty when using XSESSION with 'startx'
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo X packagers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-25 22:56 UTC by Rick Harris
Modified: 2012-10-26 23:23 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
/etc/X11/xinit/xinitrc.d/05-desktop-session (05-desktop-session,109 bytes, text/plain)
2012-10-25 22:56 UTC, Rick Harris
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rick Harris 2012-10-25 22:56:53 UTC
Created attachment 327434 [details]
/etc/X11/xinit/xinitrc.d/05-desktop-session

More of an enhancement than a bug, but when using the XSESSION variable to 'startx' in runlevel 3, the resulting X11 session started has an empty $DESKTOP_SESSION environment variable.

This variable is getting depended on more and more to perform other functions from scripts landing in /etc/X11/xinit/xinitrc.d/.

Attached is a xinitrc.d script that sets the DESKTOP_SESSION variable to be the same as ${XSESSION} if it hasn't already been filled by a login manager.

Thoughts ?
Comment 1 Samuli Suominen (RETIRED) gentoo-dev 2012-10-26 08:19:59 UTC
(In reply to comment #0)
> Thoughts ?

Upstream Xfce is handling this on it's own within /etc/xdg/xfce4/xinitrc:

# 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

I don't have XSESSION set to anything:

$ echo $XSESSION $DESKTOP_SESSION
xfce

Wouldn't this patch feed the wrong value to the DESKTOP_SESSION variable and, ths, cripple the setting done by Xfce itself?
Comment 2 Samuli Suominen (RETIRED) gentoo-dev 2012-10-26 08:22:57 UTC
XSESSION can be "Xfce" or "Xfce4" as per:

/etc/X11/Sessions/Xfce4
/etc/X11/Sessions/Xfce

And DESKTOP_SESSION can be "xfce" lowercased. So this patch/improvement wouild indeed feed the wrong value to the DESKTOP_SESSION...
Comment 3 Rick Harris 2012-10-26 23:21:30 UTC
Hmm..yes I see how that's a problem.

Was trying to come up with a global solution but that can't work as all desktops do their own thing for this in subtle ways.

Thanks for replying and sorry for the noise, closing.