Configuring SLiM

Discussions Regarding Software

Moderator: Moderators

Configuring SLiM

Postby Johnny Who » Sat Sep 15, 2012 14:39

I have recently replaced gdm with slim in order to save memory. I have enabled the default user login and my username, but I the default session is the login shell (it logs me in a terminal). I can select the seesion with F1, but I would like to make log me in the session I used last time. For instance, I am using gnome, and I want my next login to be automatically gnome, if I use mate, I want it to log me into Mate automaticaly the next time, etc. How do I configure it?
Note: It reads the available sessions from sessiondir.
Johnny Who
Simple Hen
 
Posts: 90
Joined: Fri Aug 10, 2012 10:51

Re: Configuring SLiM

Postby Fitzcarraldo » Sat Sep 15, 2012 21:58

I'm no expert in SLiM, but I don't think it is possible to configure SLiM to boot by default the X session you selected last time using F1. At least I can't see an option for that listed in the SLiM Manual.

However, the global default X session is defined in the file /etc/env.d/90xsession. for example:

Code: Select all
XSESSION="Xfce4"

so you could try using a Bash script to write the current value of the environment variable XSESSION to the file /etc/env.d/90xsession when you shut down. The script would have to be put in the directory /etc/local.d/, have the suffix ".stop" and be executable. For example, you (as root user) could create the file /etc/local.d/xsession.stop containing:

Code: Select all
#!/bin/sh
echo 'XSESSION="'$XSESSION'"' > /etc/env.d/90xsession

and make it executable:

Code: Select all
# chmod +x /etc/local.d/xsession.stop

Check if the initscript local is in the default runlevel:

Code: Select all
# rc-update | grep local

It should be in SL if I recall correctly but, if it isn't, you can add it:

Code: Select all
# rc-update add local default

I cannot test this myself, as I only have one DE (Xfce) installed on the machine on which I am using SLiM. So I'm not sure if it would work. You'll have to try it and see.
User avatar
Fitzcarraldo
Sagely Hen
 
Posts: 7335
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom


Return to Software in General

Who is online

Users browsing this forum: No registered users and 3 guests