(SOLVED) LightDM Default Session and x-session-manager setup

VastOne

Crikey some of this stuff is dated that I am researching...

PackRat note my edit above
VSIDO      VSIDO Change Blog    

    I dev VSIDO

PackRat

#16
You only have fluxbox installed correct? If so that is right. There is only one so you don't see the list. You can try

sudo apt-get install twm

to add a second wm (no dependencies with twm) and then register it. Should produce a list with fluxbox and twm.

It looks like the priority number can be positive integer greater than 0, and the highest one gets to be default for automode (0 on the list). Openbox is priority 40, so I gave fluxbox 100 so it is now automode default. This is probably a way to keep fluxbox the default in case another WM/DE is installed. If the DE is packaged with a high priority it will overwrite the default; so assign a really high priority to what you want.

I reconfigured my laptop with -

1.  mv $HOME/.xsession  $HOME/.xsession_backup        < -- I didn't know I had this file openbox may have created it; lightdm will use it if it exists

2.  change lightdm.conf back to user-session=default

3. use sudo update-alternatives --config x-session-manager to select fluxbox.

Reboot and select Default from lightdm menu; Hello fluxbox!
I am tired of talk that comes to nothing.
-- Chief Joseph

...the sun, the darkness, the winds are all listening to what we have to say.
-- Geronimo

VastOne

#17
^ Verified!  Nice one PackRat...

The solution was there, understanding it was the journey

Well done sir! I really appreciate you digging till the end...
VSIDO      VSIDO Change Blog    

    I dev VSIDO

VastOne

For the record I am marking this solved with 3 different ways to get to what we were after and by renaming the subject... this will also assist anyone searching for what we were after in google fu

(PackRat, if you want to make this a How To by all means have at it.. it is your work)

The first method is to edit /etc/lightdm.conf and make sure this:

Quotechange -

#user-session=default

to

user-session=fluxbox

The second solution is to add .dmrc to /etc/skel which in turn gets installed to every user who ever logs in, or copy/create it in ~/home:

.dtrc


[Desktop]
Language=en_US.utf8
Session=fluxbox


And the final and real solution is to remove or rename any .xsession file in /home (and/or /etc/skel) and to run the following:


sudo update-alternatives --install "/usr/bin/x-session-manager" "x-session-manager" "/usr/bin/startfluxbox" 100


and then

sudo update-alternatives --config x-window-manager

Thank you again PackRat for showing once more that we do not run from challenges but demand them!
VSIDO      VSIDO Change Blog    

    I dev VSIDO

PackRat

This thread can be the HowTo.

Do you have a $HOME/.xsession file? I did not know that file existed on my systems prior to researching the /etc/alternatives system of Debian. The default WM on both my systems was openbox-session so I'm assuming either lightdm or openbox creates this file at some point - kind of bad IMO because, as a configuration file for X, it can conflict with any existing versions of .xinitrc or .xsession that exist (typically in $HOME or /etc/X11)

If you do not have one, try this as a test -

create a $HOME/.xsession with (note that there is no leading #!/bin/sh):

xterm &
exec /usr/bin/startfluxbox


reboot (you can probably just logout if that's more convenient for you, I rebooted to flush any cache associated with an X-session)

Log in with lightdm after selecting default from the pull-down menu. You should end up in a fluxbox session with an xterm at your disposal, and since lightdm (systemd?) handles all the dbus and consolekit stuff, you should still be able to auto mount removable media.

A more generic way to set up fluxbox as default for VSIDO with lightdm as login manaager would be:

1. leave ligfhtdm installed with the defaults, mainly "user-session=default"  -- updates to lightdm tend to overwrite it's config files so this is an install and basically (hopefully) forget

2. Use update-alternatives to set up fluxbox as default

sudo update-alternatives --install "/usr/bin/x-session-manager" "x-session-manager" "/usr/bin/startfluxbox" 100   <-- give it a priority of 100 so it will be default in automode, openbox default is 40

# followed by

sudo update-alternatives --config x-window-manager     <-- if fluxbox is only window manager, you'll get a message that it's default, if you have openbox installed again, be sure to select fluxbox from the list (it will be 1 or 2) do not just go with 0; I don't know why, just seems to work better that way, auto versus manual mode, I suspect.


These two steps were enough to get fluxbox as default on my laptop, but my desktop was stuck in the loop where I was kicked out to the login screen until I selected fluxbox from the list.

3. To avoid that loop, create a $HOME/.xsession with one line:

exec /usr/bin/startfluxbox

put that in /etc/skel

Apparently lightdm looks for the $HOME/.xsession file first, and then moves on to the defaults set up in /etc/X11 and/or /etc/alternatives (really simplistic explanation). That loop where a user is kicked back to the login screen may be a bug in lightdm where it fails if the $HOME/.xsession file does not exist (or is blank?) rather than move on to the system defaults - also, lightdm didn't recognize my $HOME/.xinitrc and log into the default specified there.

The $HOME/.dmrc file is (should be) overwritten every time you log in with lightdm, it's there to remember your last login and sets the selection in the lightdm pull-down menu as far as I know. You can have it set to fluxbox in /etc/skel, but that won't be a permanent fix for a system with more than one WM.

I am tired of talk that comes to nothing.
-- Chief Joseph

...the sun, the darkness, the winds are all listening to what we have to say.
-- Geronimo

VastOne

The .xsession you were seeing with exec ck-launch-session openbox-session was an old remnant from days gone past that was stuck in /etc/skel and never again looked at

It has been removed
VSIDO      VSIDO Change Blog    

    I dev VSIDO

PackRat

Cool.

What else is in /etc/skel? Perhaps an audit is in order before the next build.

And I confirmed, if $HOME/.xsession exists but is an empty file or has errors - like trying to start a WM that is not installed, lightdm will fail and take you back to the login screen - on my systems anyway. So either use it, or [re]move it.
I am tired of talk that comes to nothing.
-- Chief Joseph

...the sun, the darkness, the winds are all listening to what we have to say.
-- Geronimo

VastOne

/etc/skel is what defines each and every VSIDO desktop and is audited on every build. The remnants of old OpenBox files are leftovers from when we did have open box as a session.I left them for specific reasons that if a person installs open box it would give them a VSIDO desktop . These will all be removed now
VSIDO      VSIDO Change Blog    

    I dev VSIDO

statmonkey

Just starting to read through this thread.  Excellent work as always and greatly appreciate the learning opportunity.  I feel a little better armed than I was and thank you PackRat for following through to the bitter end your effort is a big help.

statmonkey

Quote from: VastOne on October 14, 2014, 05:33:10 PM
Being a moderator at #! meant nothing as far as knowing the underlying code or any discussions with the dev, it never happened.  It also was a thankless job...  :-[

I am sure it was meaningless but I promise it wasn't thankless.  ;)   I thanked you several times .... errr I think I did.  If I didn't then "THANK YOU!!!"  You did some pretty good stuff over there.

VastOne

@PackRat
Quote
The $HOME/.dmrc file is (should be) overwritten every time you log in with lightdm, it's there to remember your last login and sets the selection in the lightdm pull-down menu as far as I know. You can have it set to fluxbox in /etc/skel, but that won't be a permanent fix for a system with more than one WM.

The goal and the very reason for this journey is to make sure FluxBox is the very first VSIDO experience on the first boot, then the vsido-welcome script ... 

After that, it is all on you!

@statmonkey

I appreciate that man.. seems a hundred years ago now   ;)
VSIDO      VSIDO Change Blog    

    I dev VSIDO

airtime

i hate you geniuses hahaha -- I have been pulling my hair out all week trying to figure this out. I finally decided to come to the forum and found I wasnt the only one. lighdm was stuck in a loop and i had to log into the terminal and run startx.

wow  ???

ozitraveller

Just wanted to say thanks here to everyone who contributed, this was the missing piece to bring my wheezy live-builds up to jessie.  ;D

I now have a fluxbox beta 2 version out here:
http://sourceforge.net/projects/linnix/files/?source=navbar

Ozi