[LightDM] Setting default X session

Didier Roche didrocks at ubuntu.com
Mon Aug 29 00:44:00 PDT 2011


Le 13/08/2011 18:32, Yves-Alexis Perez a écrit :
> On ven., 2011-08-12 at 08:27 +0200, Didier Roche wrote:
>> Package should in their postinst call this one to set themselves as
>> default (using the --keep-old options) and remove them on
>> install/removal. For instance:
>> http://launchpadlibrarian.net/76923334/gnome-session_3.1.3-0ubuntu9_3.1.3-0ubuntu10.diff.gz
>> to set the default session to "ubuntu" for the ubuntu desktop case.
>> and:
>> http://launchpadlibrarian.net/76923333/unity-greeter_0.0.2-0ubuntu1_0.0.2-0ubuntu2.diff.gz
>> for the greeter.
>>
>> So basically, installing them will set the first installed one (we don't
>> expect having multiple greeters in a CD spin for instance) as the
>> default. Then, casper has now a fix for just adding the autologin part
>> without hammering those things:
>> http://launchpadlibrarian.net/77000287/casper_1.277_1.278.diff.gz
>>
>> Please note that this is very similar to the patches I made for gdm back
>> in the lucid days (10.04) which seems to have fit the numerous flavors
>> and derivatives we have.
> This might work in Ubuntu, but I don't expect each and every “desktop
> environment” (including window managers) to do that. That might work as
> a best effort (like I could do this in Xfce) but not for a whole
> distribution like Debian.
Sorry for the late answer, but I was on vacations,

This worked well with a gdm patch I made at the time between xubuntu, 
ubuntu, ubuntu netbook edition, edubuntu and the whole ltsp environment 
(which had other greeter need). Indeed, this require some work and 
coordination between people but it prooved to be possible.
>
> And even with that, what happens when:
>
> * desktop A is installed, setting the default session to A
> * desktop B is installed, setting the default session to B (old default
> to A)
> * desktop C is installed, setting the default session to C (old default
> to B)
> * one of them is removed
>
> Who is the new default, and why? I don't think there's a way to have a
> really consistent situation (and one which would fit the user).

See /usr/lib/lightdm/lightdm-set-defaults --help, in particular:

   -k, --keep-old     Only update if no default already set
   -r, --remove       Remove default value if it's the current one

Knowing that the lightdm policy is "if no greeter set in the 
configuration file, do nothing" (no fallback). So, all depends on the 
option set by the greeter. I would advise using --keep-old to not 
overwrite the selection (without it, it updates the current value).

>
> So all in all, I think that managing the default with alternatives,
> which is an existing, working system which does exactly the same kind of
> thing you tried to fix, might be the best way we have. It's not perfect
> (the whole priority thing and the fact it's Debian-based) but it can
> work.

It didn't work when we tried to coordinate between ubuntu flavors for 
gdm, even how hard we tried to do that and used that for a while (other 
people from different flavors can confirm there). In particular as in 
one configuration file, you have multiple values which can be impacted 
by different components and not just one package (there is the greeter, 
there is the user session which depends if you are on a live cd or 
installed version), and such…

Note that using alternatives need as well coordination between the 
different "desktop environment" managers.

If that works for you, good, the option is still there to use the other 
way though.

Regards,
Didier



More information about the LightDM mailing list