The nuts and bolts => X-Rated => Topic started by: black-clover on August 23, 2017, 06:48:29 pm

Title: Installing Lightdm
Post by: black-clover on August 23, 2017, 06:48:29 pm
Hello everybody,

I' d like to replace Gdm with Lightdm, the reason being that Lightdm allows a very smooth transition from login to the Xfce desktop, whereas with Gdm there is always a flash before it loads Xfce.
Assuming that I remove Gdm and install Lightdm from sources, how do I configure the system so it would load it properly?
Title: Re: Installing Lightdm
Post by: roarde on August 24, 2017, 11:16:59 am

Here's where gdm is launched from within /etc/rc.d/rc.X:
Code: [Select]
## launch a login manager
  case $DM in
    if [ -x $KDM_CMD ]; then
      #echo KDE Display Manager
      exec $KDM_CMD -nodaemon
    if [ -x $GDM_CMD ]; then
      #echo GNOME Display Manager
      exec $GDM_CMD -nodaemon
    if [ -x $WDM_CMD ]; then
      #echo WING Display Manager
      buildsessions WDM &> /dev/null
      exec $WDM_CMD -nodaemon > /dev/null
    if [ -x $XDM_CMD ]; then
      #echo XFree86 Display Manager
      exec $XDM_CMD -nodaemon
    # error
    echo "Hey, you don't have KDM, GDM, WDM, or XDM."
    echo "Can't use GUI mode without one of them installed, mate."
    sleep 30
$GDM_CMD, etc were already set further up the script.

When that was written many years ago, it had to be done pretty much that way. But it would be nice to have a setup that allows for external configuration of X display manager instead of its being hard-coded in a script.

You can start tracking the entire initialization process (after boot and initrd) by looking over /etc/inittab.

Title: Re: Installing Lightdm
Post by: black-clover on August 24, 2017, 12:42:15 pm
Thanks alot, this is fascinating.
Title: Re: Installing Lightdm
Post by: roarde on August 25, 2017, 01:38:31 pm
If it becomes more frustrating than fascinating, we'll give more detail. Just figured you didn't want that right now :)
Title: Re: Installing Lightdm
Post by: black-clover on September 10, 2017, 01:55:44 pm
is /etc/rc.d/rc.x the only file I would need to edit in order to start lightdm?

Also, considering the binary the lightdm package installed is /usr/sbin/lightdm, how would I have to modify the entry in rc.x?
Title: Re: Installing Lightdm
Post by: roarde on September 10, 2017, 03:51:08 pm
I think /etc/rc.d/rc.X is the only file that needs changing in order to start Lightdm, but I'm not sure about that. Thing is, you still need a working configuration of Lightdm itself. I don't know how Lightdm would choose which greeter to use, for example. That's part of figuring out its configuration.

As for how to modify rc.X, see if you can read it through, or at least chase down references to the various display managers and work from there. I do notice that if DISPLAY_MANAGER is not set, the order of trying display managers is kdm, gdm, wdm, xdm, and none. You'd want to insert ldm naturally, but also may want to change the order of those already there. Because of how VL implements various flavors, you actually do want kdm first. Then gdm, no doubt. Choose between ldm and xdm next, and tag on wdm after that for those waxing nostalgic. For bonus points, the NONE entry isn't really necessary, but further changes would be needed to leave it out.

You can include the new rc.X in any potential slackbuild, but you want to do that without forcing those installing the package to start using Lightdm right away. Take a look at how the .new files are handled in NetworkManager.SlackBuild. You have to look at the config() section that gets added to the to see it. What's missing there is a notice to take a look at the .new files, which would be printed on the screen when the package is installed and the doinst is run.

What you were asking about was the difference between /usr/bin and /usr/sbin. I actually think display managers belong in /usr/sbin, but the case can be made for /usr/bin as well. Make your choice. Adding /usr/sbin/lightdm is not a problem, just do it as the others (like /usr/bin/gdm) are done. If you want lightdm in /usr/bin instead, there's a ./configure option that would do that.

You probably should websearch "lightdm slackbuild" and take a look at some of the results. There are small differences in the way Slackware and VL implement PAM and the display managers, so read carefully.
Title: Re: Installing Lightdm
Post by: black-clover on September 14, 2017, 03:44:07 pm
Thanks for the info,

I decided to try this step by step, editing /etc/rc.d/rc.x to learn the ropes.
First, I changed:


and xdm showed up after rebooting (albeit I was not able to make it start the right wm)
Since Slim is already in the repo, I decided to try that next.

I edited  rc.x as follow:

Code: [Select]
# This setting will be changed by vxdmset

# Don't touch below these. Expert is excepted ;)

and below;

Code: [Select]
    if [ -x $SDM_CMD ]; then
      #echo SDM Display Manager
      exec $SDM_CMD -nodaemon

Of course it didn't work.
How should I change the entries?
Title: Re: Installing Lightdm
Post by: roarde on September 14, 2017, 10:20:34 pm
The "vxdmset" mentioned was part of vasm originally, but the most recent vasm-legacy doesn't have it; it's unavailable unless one grabs the old source. Setting display manager manually by editing rc.X is a valid method. Why not list all of the display managers up front, comment each out, then uncomment the one used. A cheap way of documenting the possibly available display managers.

and so on.

The entries as you have them are fine, though it would be more consistent to add slim to the "for" list too, so it can be tested when DISPLAY_MANAGER isn't set, like the rest are.

Because of the chance of breaking someone's configured, working system (and a few other reasons), I'm guessing that an offer of a new official rc.X for 7.2 may not be accepted. It's easy enough for interested users to customize on their own while 7.2 is the current version.

The problem is in slim's configuration. If you installed slim from the command line, you were shown a note to check out /etc/ and /etc/logrotate.d/ If you haven't, rename each of those without the .new extension.

Now look at /etc/slim.conf:
Code: [Select]
login_cmd       exec /bin/bash -login ~/.xinitrc %sessionThat's only going to work when a user has an .xinitrc that looks very similar to the sample provided with the Slim source code. (It would be nice to have that copied to /usr/doc/slim-*/, but I'm not taking the time to do that.) Comment out that login_cmd line in slim.conf. There must be better ways to do this, but here's a working line so you can get on with what you're doing:
Code: [Select]
login_cmd       exec /bin/bash -login -c ". ~/.xinitrc || . /etc/X11/xinit/xinitrc"
A Bash shell is started with a fresh environment just as in a terminal login, except that what follows "-c" is executed: That shell tries to source a user's .xinitrc; should that fail -- usually because the user doesn't have one --, then /etc/X11/xinit/xinitrc is sourced. That's usually a link to the system's default desktop session, as distinguished from the default session that's just an xterm. A VL installation has that linking done by default.

Gdm, and I think Kdm, use a different method. The user's preferred session type is given in ~/.dmrc. I once chased down exactly how things end up there, but have forgotten. Can anyone remind me? Anyway, whatever Session= is pointing to, the desktop file /usr/share/xsessions/<Session>.desktop is read and its Exec= setting is executed, with "default" being  a special case.

A lot of different ways to go here, but the edit above to slim.conf will get you something working. The flash you mentioned elsewhere that GDM has isn't present for Slim. I resized my desktop wallpaper to fit my screen so that it wouldn't have to be resized on the fly. Icewmvmods is my DE. Because spacefm has a flash of its own and doesn't handle background transparency on startup, I disabled spacefm control of the desktop in the IceWM startup file, then set IceWM preferences to have icewmbg handle the background. Then I set both Slim and icewmbg to use the background made from the wallpaper above. As far as can be seen, all that happens after login is that the word "Login:" and the text-typing box disappear, leaving me in my desktop and looking at the same wallpaper, with no flash at all.

Nice find. I think we'd all forgotten about Slim.
Title: Re: Installing Lightdm
Post by: black-clover on September 15, 2017, 01:31:21 pm
thanks for your input.

Everything you say makes a lot of sense, as usual.
I just hacked away whatever I didn't need in the rc.x file and now Slim starts as default display manager in my project VL.
Since it is going to be the only DM installed I think that's ok.

It's nice to know that Slim allows a smooth transition into the desktop, which was the real issue in the first place.
I haven't had time  to deal with the graphic setup yet, since I want to deal with functionality first.
I copied Slim sample .xinitrc to ~/ and it starts Jwm all right.
I also tried

Code: [Select]
login_cmd       exec /bin/bash -login -c ". ~/.xinitrc || . /etc/X11/xinit/xinitrc"
In the slim.conf file but I get an error, it just can't execute login.

Slim seems to be a versatile DM, and I just got started, so there's quite a bit to learn about its functions.