SLiM can be loaded on startup by entering it in your DAEMONS array in {{ic|/etc/rc.conf}} or by modifying {{ic|/etc/inittab}}: see [[Display Manager#Loading the display manager]] for detailed instructions. If you use [[systemd]], just enable {{ic|slim.service}}. [[Dbus]] appears to be required since version 1.3.3 of SLiM.

+

{{Note|{{pkg|slim}} no longer has ConsoleKit support, but relies on systemd-logind, and the system being booted with systemd.}}

+

+

Enable the '''slim''' [[Daemons|daemon]]. With systemd, it is no longer possible to start slim using {{ic|inittab}}.

=== Single environments ===

=== Single environments ===

Line 43:

Line 46:

#

#

−

exec [session-command]

+

exec <session-command>

}}

}}

−

SLiM reads the local {{ic|~/.xinitrc}} configuration and then launches the desktop according to what is in that file. If you do not have a {{ic|~/.xinitrc}} file, you can use the skeleton file by:

+

Replace {{ic|<session-command>}} with the appropriate session command. Some examples of different desktop start commands:

−

−

$ cp /etc/skel/.xinitrc ~

−

−

Remember to make .xinitrc executable:

−

−

chmod +x ~/.xinitrc

−

−

Replace {{ic|[session-command]}} with the appropriate session command. Some examples of different desktop start commands:

{{bc|

{{bc|

Line 71:

Line 66:

For detailed instructions on how to start the various environments, refer to the appropriate wiki pages.

For detailed instructions on how to start the various environments, refer to the appropriate wiki pages.

−

{{Note|{{pkg|slim}} is ConsoleKit capable since version 1.3.3. Unless you happen to run an old version, you must '''no''' longer include {{ic|ck-launch-session}} in your .xinitrc or slim.conf login_cmd. You should still have {{ic|dbus-launch}} in your login_cmd, see [[#SLiM_and_Gnome_Keyring]], since this gives subprocesses of your session the correct permissions (e.g. to mount something with [[Wikipedia:GVFS|gvfs-mount]], like [[Pcmanfm]] does).}}

+

SLiM reads the local {{ic|~/.xinitrc}} configuration and then launches the desktop according to what is in that file. If you do not have a {{ic|~/.xinitrc}} file, you can use the skeleton file by:

+

+

$ cp /etc/skel/.xinitrc ~

+

+

Remember to make {{ic|~/.xinitrc}} executable:

+

+

chmod +x ~/.xinitrc

=== Autologin ===

=== Autologin ===

Line 85:

Line 86:

=== Zsh ===

=== Zsh ===

+

{{Note|If you don't know what is zsh and you did not install it - ignore this paragraph.}}

The default login command will not initialize your environment correctly [http://www.edsel.nu/2010/06/04/slim-simple-login-manager-on-freebsd/ [source]]. Change the login_cmd line in {{ic|/etc/slim.conf}} to:

#login_cmd exec /bin/sh - ~/.xinitrc %session

#login_cmd exec /bin/sh - ~/.xinitrc %session

Line 95:

Line 97:

To be able to choose from multiple desktop environments, SLiM can be setup to log you into whichever you choose.

To be able to choose from multiple desktop environments, SLiM can be setup to log you into whichever you choose.

−

Put a case statement similar to this one in your {{ic|~/.xinitrc}} file and edit the sessions variable in {{ic|/etc/slim.conf}} to match the names that trigger the case statement. You can choose the session at login time by pressing F1. Note that this feature is experimental.

+

Put a case statement similar to this one in your {{ic|~/.xinitrc}} file and edit the sessions variable in {{ic|/etc/slim.conf}} to match the names that trigger the case statement. You can cycle through sessions at login time by pressing F1. Note that this feature is experimental.

{{bc|1=

{{bc|1=

−

# The following variable defines the session which is started if the user doesn't explicitly select a session

Note that, in this script, the default option simply executes, e.g., exec icewm (if that is the default session), without icewmbg and icewmtray. You may want simply to repeat everything you've put under, e.g., icewm) again under *). When done use F1 to cycle through sessions in SLiM.

+

{{Note|<nowiki>In the latest version (1.3.5), slim does not preset any default session, so using a DEFAULT_SESSION variable will not work the way it used to. Instead put your default session as the last case and |*) to the statement (see above)</nowiki>}}

=== Themes ===

=== Themes ===

Line 135:

Line 131:

# pacman -S slim-themes archlinux-themes-slim

# pacman -S slim-themes archlinux-themes-slim

−

The {{Pkg|archlinux-themes-slim}} packages contains several different themes. Look in the directory of {{ic|/usr/share/slim/themes}} to see the themes available. Enter the theme name on the {{ic|current_theme}} line in {{ic|/etc/slim.conf}}:

+

The {{Pkg|archlinux-themes-slim}} packages contains several different themes ([http://imageshack.us/photo/my-images/27/slimthemes.png/ slimthemes.png]). Look in the directory of {{ic|/usr/share/slim/themes}} to see the themes available. Enter the theme name on the {{ic|current_theme}} line in {{ic|/etc/slim.conf}}:

#current_theme default

#current_theme default

Line 197:

Line 193:

=== Shutdown, reboot, suspend, exit, launch terminal from SLiM ===

=== Shutdown, reboot, suspend, exit, launch terminal from SLiM ===

−

You may shutdown, reboot, suspend, exit or even launch a terminal from the SLiM login screen. To do so, use the values in the username field, and the root password in the password field:

+

You may shutdown, reboot, suspend, exit or even launch a terminal from the SLiM login screen. To do so, use the values in the username field, and the root password in the password field:

* To launch a terminal, enter '''console''' as the username (defaults to xterm which must be installed separately... edit {{ic|/etc/slim.conf}} to change terminal preference)

* To launch a terminal, enter '''console''' as the username (defaults to xterm which must be installed separately... edit {{ic|/etc/slim.conf}} to change terminal preference)

Line 207:

Line 203:

=== SLiM init error with rc.d daemon ===

=== SLiM init error with rc.d daemon ===

−

If you initialize SLiM with {{ic|/etc/rc.conf}} inside the DAEMONS array and it fails to initialize it's most likely a lock file issue. SLiM creates a lock file in {{ic|/var/lock}} on each initialization, however, in most cases the lock folder in /var does not exist preventing SLiM from initializing. Check to make sure {{ic|/var/lock}} exists, if it does not you can create it by typing the following:

+

If you initialize SLiM with {{ic|/etc/rc.conf}} inside the DAEMONS array and it fails to initialize it's most likely a lock file issue. SLiM creates a lock file in {{ic|/var/lock}} on each initialization, however, in most cases the lock folder in {{ic|/var}} does not exist preventing SLiM from initializing. Check to make sure {{ic|/var/lock}} exists, if it does not you can create it by typing the following:

# mkdir /var/lock/

# mkdir /var/lock/

Line 213:

Line 209:

=== Power-off error with Splashy ===

=== Power-off error with Splashy ===

−

If you use Splashy and SLiM, sometimes you can't power-off or reboot from menu in GNOME, Xfce, LXDE or others. Check your {{ic|/etc/slim.conf}} and {{ic|/etc/splash.conf}}; set the {{ic|1=DEFAULT_TTY=7}} same as {{ic|xserver_arguments vt07}}.

+

If you use Splashy and SLiM, sometimes you can't power-off or reboot from menu in GNOME, Xfce, LXDE or others. Check your {{ic|/etc/slim.conf}} and {{ic|/etc/splash.conf}}; set the {{ic|1=DEFAULT_TTY=7}} same as {{ic|xserver_arguments vt07}}.

=== Power-off tray icon fails ===

=== Power-off tray icon fails ===

Line 239:

Line 235:

=== SLiM and Gnome Keyring ===

=== SLiM and Gnome Keyring ===

−

If you are using SLiM to launch a Gnome session and have trouble accessing your keyring, for example not being automatically authenticated on login, add the following lines to {{ic|/etc/pam.d/slim}} (as discussed [http://bugs.archlinux.org/task/18637 here]).

+

If you are using SLiM to launch a Gnome session and have trouble accessing your keyring, for example not being automatically authenticated on login, add the following lines to {{ic|/etc/pam.d/slim}} (as discussed [https://bugs.archlinux.org/task/18637 here]).

auth optional pam_gnome_keyring.so

auth optional pam_gnome_keyring.so

session optional pam_gnome_keyring.so auto_start

session optional pam_gnome_keyring.so auto_start

Line 248:

Line 244:

If you use a screensaver you also have to add

If you use a screensaver you also have to add

auth optional pam_gnome_keyring.so

auth optional pam_gnome_keyring.so

−

to {{ic|/etc/pam.d/gnome-screensaver}} for example (replace gnome-screensaver with slimlock,slock,whatever you use). If you don't do that, your keyring is locked when screen is locked by your screensaver and not unlocked again after logging back in.

+

to {{ic|/etc/pam.d/gnome-screensaver}} for example (replace {{ic|gnome-screensaver}} with {{ic|slimlock}}, {{ic|slock}}, whatever you use). If you don't do that, your keyring is locked when screen is locked by your screensaver and not unlocked again after logging back in.

−

However, this fix alone no longer works since Gnome 2.30. Further changes are necessary as described [http://bugs.archlinux.org/task/18930 here]. Modifying the {{ic|login_cmd}} line in {{ic|/etc/slim.conf}}:

+

However, this fix alone no longer works since Gnome 2.30. Further changes are necessary as described [https://bugs.archlinux.org/task/18930 here]. Modifying the {{ic|login_cmd}} line in {{ic|/etc/slim.conf}}:

As of GNOME 3, simply adding {{ic|dbus-launch}} after {{ic|ck-launch-session}} will work, without needing to edit {{ic|/etc/pam.d/slim}}.

+

As of GNOME 3.4, you need to edit {{ic|<nowiki>/etc/pam.d/{slim,passwd}</nowiki>}} as mentioned above, so that {{ic|<nowiki>/etc/pam.d/slim</nowiki>}} looks like:

+

#%PAM-1.0

+

auth requisite pam_nologin.so

+

auth required pam_env.so

+

auth required pam_unix.so

+

auth optional pam_gnome_keyring.so

+

account required pam_unix.so

+

session required pam_limits.so

+

session required pam_unix.so

+

session optional pam_gnome_keyring.so auto_start

+

password required pam_unix.so

+

and {{ic|<nowiki>/etc/pam.d/passwd</nowiki>}}

+

#%PAM-1.0

+

password required pam_unix.so sha512 shadow nullok

+

password optional pam_gnome_keyring.so

+

As of 2012-10-13, {{ic|<nowiki>/etc/pam.d/gnome-screensaver</nowiki>}} already contains the {{ic|<nowiki>pam_gnome_keyring.so</nowiki>}} instruction.

−

As of GNOME 3.1, you need to add {{ic|dbus-launch}} after {{ic|ck-launch-session}} and edit {{ic|<nowiki>/etc/pam.d/{slim,passwd}</nowiki>}}, otherwise the keyring will not be automatically unlocked. I never tried it on 3.0, so maybe the above information about GNOME 3 is wrong.

+

The correct positioning of the {{ic|<nowiki>pam_gnome_keyring.so</nowiki>}} instructions were taken from [http://live.gnome.org/GnomeKeyring/Pam here].

+

+

After editing the above files, you need to edit {{ic|<nowiki>/etc/inittab</nowiki>}}.

The solutions mentioned here and also further information are found [http://live.gnome.org/GnomeKeyring/Pam here].

The solutions mentioned here and also further information are found [http://live.gnome.org/GnomeKeyring/Pam here].

Line 269:

Line 282:

/usr/bin/awesome

/usr/bin/awesome

−

After login check if there is only one gnome-keyring-daemon instance running (ps -A | grep gnome). If those lines are executed too early then you have 4 instances running which is not good.

+

After login check if there is only one gnome-keyring-daemon instance running ({{ic|ps -A | grep gnome}}). If those lines are executed too early then you have 4 instances running which is not good.

−

You also should notice that seahorse for example does not show any pkcs11 errors anymore and that your keyring is unlocked all the time and does not lock itself anymore. Finally gnome-keyring is fully functional like in Gnome. See also [https://bbs.archlinux.org/viewtopic.php?pid=1019845#p1019845 here].

+

You also should notice that seahorse for example does not show any pkcs11 errors anymore and that your keyring is unlocked all the time and does not lock itself anymore. Finally {{pkg|gnome-keyring}} is fully functional like in Gnome. See also [https://bbs.archlinux.org/viewtopic.php?pid=1019845#p1019845 here].

−

−

=== SLiM and Environment Variables ===

−

If you have trouble with environment variables changing after a session is started, one cause could be the module pam_env.so, by default, reads the file {{ic|/etc/environment}} and sets up the environment accordingly.

−

−

For example: I use SLiM, which fires up a XFCE4 session upon valid authentication. When this is done my terminal(xfterm4) can't print Unicode characters(LC_* environment variables has been defaulted/altered to "POSIX"). But when I start XFCE4 manually, like so: {{ic|startxfce4}}, Unicode characters on my terminal works fine.

−

−

This can be fixed by adding this to {{ic|/etc/environment}} or your user specific file: {{ic|$HOME/.pam_environment}}:

−

# You can change these to fit your preference, of course.

−

LANG="en_US.UTF-8"

−

LC_COLLATE="C"

−

−

Alternatively, you can modify the line in {{ic|/etc/pam.d/slim}} from:

−

{{bc|session required pam_env.so}}

−

To:

−

{{bc|1=session required pam_env.so envfile=<yourfile>}}

−

Where <yourfile> is the name of the file you want PAM to recognize as your default environment file, when starting a new session from SLiM.

=== Setting DPI with SLiM ===

=== Setting DPI with SLiM ===

−

The Xorg server generally picks up the DPI but if it doesn't you can specify it to SLiM. If you set the DPI with the argument -dpi 96 in {{ic|/etc/X11/xinit/xserverrc}} it will not work with SLiM. To fix this change your {{ic|slim.conf}} from:

+

The Xorg server generally picks up the DPI but if it doesn't you can specify it to SLiM. If you set the DPI with the argument -dpi 96 in {{ic|/etc/X11/xinit/xserverrc}} it will not work with SLiM. To fix this change your {{ic|slim.conf}} from:

xserver_arguments -nolisten tcp vt07

xserver_arguments -nolisten tcp vt07

Line 301:

Line 298:

=== Use a random theme ===

=== Use a random theme ===

−

Use the {{ic|current_theme}} variable as a comma separated list to specify a set from which to choose. Selection is random.

+

Use the {{ic|current_theme}} variable as a comma separated list to specify a set from which to choose. Selection is random.

===Move the whole session to another VT===

===Move the whole session to another VT===

Line 485:

Line 482:

| session_shadow_color ||{{ic|#FFFFFF}}

| session_shadow_color ||{{ic|#FFFFFF}}

|}

|}

−

+

== Uninstallation ==

+

To completely remove SLiM:

+

{{bc| # pacman -Rns slim

+

# rm /etc/systemd/system/display-manager.service

+

}}

== See also ==

== See also ==

* [http://slim.berlios.de/ SLiM homepage]

* [http://slim.berlios.de/ SLiM homepage]

* [http://slim.berlios.de/manual.php SLiM documentation]

* [http://slim.berlios.de/manual.php SLiM documentation]

Revision as of 08:45, 23 April 2013

SLiM is an acronym for Simple Login Manager. SLiM is simple, lightweight and easily configurable. SLiM is used by some because it does not require the dependencies of GNOME or KDE and can help make a lighter system for users that like to use lightweight desktops like Xfce, Openbox, and Fluxbox.

Multiple environments

To be able to choose from multiple desktop environments, SLiM can be setup to log you into whichever you choose.

Put a case statement similar to this one in your ~/.xinitrc file and edit the sessions variable in /etc/slim.conf to match the names that trigger the case statement. You can cycle through sessions at login time by pressing F1. Note that this feature is experimental.

Note: In the latest version (1.3.5), slim does not preset any default session, so using a DEFAULT_SESSION variable will not work the way it used to. Instead put your default session as the last case and |*) to the statement (see above)

Themes

The archlinux-themes-slim packages contains several different themes (slimthemes.png). Look in the directory of /usr/share/slim/themes to see the themes available. Enter the theme name on the current_theme line in /etc/slim.conf:

#current_theme default
current_theme archlinux-simplyblack

To preview a theme run while an instance of the Xorg server is running by:

Shutdown, reboot, suspend, exit, launch terminal from SLiM

You may shutdown, reboot, suspend, exit or even launch a terminal from the SLiM login screen. To do so, use the values in the username field, and the root password in the password field:

To launch a terminal, enter console as the username (defaults to xterm which must be installed separately... edit /etc/slim.conf to change terminal preference)

For shutdown, enter halt as the username

For reboot, enter reboot as the username

To exit to bash, enter exit as the username

For suspend, enter suspend as the username (suspend is disabled by default, edit /etc/slim.conf as root to uncomment the suspend_cmd line and, if necessary modify the suspend command itself (e.g. change /usr/sbin/suspend to sudo /usr/sbin/pm-suspend))

SLiM init error with rc.d daemon

If you initialize SLiM with /etc/rc.conf inside the DAEMONS array and it fails to initialize it's most likely a lock file issue. SLiM creates a lock file in /var/lock on each initialization, however, in most cases the lock folder in /var does not exist preventing SLiM from initializing. Check to make sure /var/lock exists, if it does not you can create it by typing the following:

# mkdir /var/lock/

Power-off error with Splashy

If you use Splashy and SLiM, sometimes you can't power-off or reboot from menu in GNOME, Xfce, LXDE or others. Check your /etc/slim.conf and /etc/splash.conf; set the DEFAULT_TTY=7 same as xserver_arguments vt07.

Power-off tray icon fails

If your power off tray icon fails, it could be due to not having root privileges. To start a tray icon with root privileges, be sure to have SLiM start the program. Edit /etc/slim.conf as follows:

sessionstart_cmd /path/to/tray/icon/program &

Login information with SLiM

By default, SLiM fails to log logins to utmp and wtmp which causes who, last, etc. to misreport login information. To fix this edit your slim.conf as follows:

SLiM and Gnome Keyring

If you are using SLiM to launch a Gnome session and have trouble accessing your keyring, for example not being automatically authenticated on login, add the following lines to /etc/pam.d/slim (as discussed here).

to /etc/pam.d/gnome-screensaver for example (replace gnome-screensaver with slimlock, slock, whatever you use). If you don't do that, your keyring is locked when screen is locked by your screensaver and not unlocked again after logging back in.

However, this fix alone no longer works since Gnome 2.30. Further changes are necessary as described here. Modifying the login_cmd line in /etc/slim.conf:

As of 2012-10-13, /etc/pam.d/gnome-screensaver already contains the pam_gnome_keyring.so instruction.

The correct positioning of the pam_gnome_keyring.so instructions were taken from here.

After editing the above files, you need to edit /etc/inittab.

The solutions mentioned here and also further information are found here.

If you have problems keeping the keyring unlocked for longer sessions, there is another thing that Gnome does:
Look at /etc/xdg/autostart/{gnome-keyring-gpg.desktop, gnome-keyring-pkcs11.desktop, gnome-keyring-secrets.desktop, gnome-keyring-ssh.desktop}.

Append the following lines to .xinitrc just before you start your wm (example here is awesome wm):

After login check if there is only one gnome-keyring-daemon instance running (ps -A ). If those lines are executed too early then you have 4 instances running which is not good.

You also should notice that seahorse for example does not show any pkcs11 errors anymore and that your keyring is unlocked all the time and does not lock itself anymore. Finally gnome-keyring is fully functional like in Gnome. See also here.

Setting DPI with SLiM

The Xorg server generally picks up the DPI but if it doesn't you can specify it to SLiM. If you set the DPI with the argument -dpi 96 in /etc/X11/xinit/xserverrc it will not work with SLiM. To fix this change your slim.conf from:

xserver_arguments -nolisten tcp vt07

to

xserver_arguments -nolisten tcp vt07 -dpi 96

Use a random theme

Use the current_theme variable as a comma separated list to specify a set from which to choose. Selection is random.

Move the whole session to another VT

Lets say you have commented out tty terminals 3-6 as you may not use them. (You may use screen and therefore only need one terminal)
So, to move the X-Server you need to change one number in the /etc/slim.conf file. Just a few lines down you should see:

xserver_arguments -nolisten tcp vt07

Simply change the vt07 to lets say vt03 as there is no agetty started there.