FS#40887 - [lightdm] run users .xsession wrapper is available

Attached to Project: Community Packages
Opened by Damjan Georgievski (damjan) - Wednesday, 18 June 2014, 17:13 GMT
Last edited by Balló György (City-busz) - Tuesday, 12 August 2014, 14:50 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Maxime Gauduin (Alucryd)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

This was already present in the Xsession script shipped with lightdm, but was removed.

I'd suggest this, instead of the "exec $@" at the end of Xsession.

if [ -x "$HOME/.xsession" -a ! -d "$HOME/.xsession" ]; then
echo "Loading user X session script"
exec "$HOME/.xsession" $@
else
exec $@
fi

.xsession is a wrapper, it will provided the session that the user choose in the greeter so it can run it,
if the user chooses so with "exec $@".

The check is "-x -a ! -d" executable that's not a directory so that .xsession could be a link too.
This task depends upon

Closed by  Balló György (City-busz)
Tuesday, 12 August 2014, 14:50 GMT
Reason for closing:  Won't implement
Comment by Balló György (City-busz) - Wednesday, 18 June 2014, 21:20 GMT
I don't think that it would be good, because LightDM would always run the .xsession script if exists instead of the selected desktop session. The .xsession script is mainly used by startx and xinit. You can create file /usr/share/xsessions/user.desktop with line 'Exec=$HOME/.xsession' on your system, which hopefully makes the same effect if you select this session.
Comment by Damjan Georgievski (damjan) - Thursday, 19 June 2014, 10:02 GMT
a user wouldn't have a random ~/.xsession file right? And just having a exec $@ would still run the chosen session.

startx and xinit don't use ~/.xsession either. They use ~/.xinitrc

The problem with /usr/share/xsessions/user.desktop is that it will only ever run ~/.xsession so you can't use it as a wrapper for the session you choose.
Comment by Balló György (City-busz) - Friday, 20 June 2014, 16:06 GMT
They have, because the xorg-xinit package provides the file /etc/skel/.xsession, which is copied into the user's directory on user creation. And the default .xsession file just launches the ~/.xinitrc script.
Comment by Damjan Georgievski (damjan) - Friday, 20 June 2014, 17:04 GMT
argh,
why was that /etc/skel/.xsession needed?
Comment by Balló György (City-busz) - Friday, 08 August 2014, 14:46 GMT
I don't know, maybe it can be dropped. Please follow the report about it:
https://bugs.archlinux.org/task/41092

Anyway, I still don't like the idea to launch a random session instead of the selected one.
Comment by Damjan Georgievski (damjan) - Saturday, 09 August 2014, 22:47 GMT
"Anyway, I still don't like the idea to launch a random session instead of the selected one."

that was not my proposal, my proposal was to run .xsession (if available) as a wrapper.
Comment by Balló György (City-busz) - Tuesday, 12 August 2014, 02:11 GMT
Why don't you satisfied with ~/.profile and ~/.xprofile ?
Comment by Damjan Georgievski (damjan) - Tuesday, 12 August 2014, 13:27 GMT
~/.profile is used by shell scripts, doesn't have anything to do with X sessions.

~/.xprofile is sourced much earlier in the Xsession process, exec-ing things there would break all other Xsession scripts.
Comment by Balló György (City-busz) - Tuesday, 12 August 2014, 14:11 GMT
I still don't think it would be a good idea, because it could be easily broken (e.g. with our default ~/.xsession file), and not supported by GDM and KDM either.

Sorry, I'm closing this task now. You can still customize your Xsession file on your system, it's part of the backup array of the lightdm package.

Loading...