Difference between revisions of "SLiM"

From ArchWiki
Jump to: navigation, search
m (Installation)
Line 11: Line 11:
  
 
=Installation=
 
=Installation=
SLiM is available from the /extra repositories:
+
SLiM is available from the /extra repositories
 
  # pacman -S slim
 
  # pacman -S slim
There is also a themes package:
+
There is also a themes package
 
  # pacman -S slim-themes
 
  # pacman -S slim-themes
 +
and an Archlinux theme
 +
# pacman -S archlinux-themes-slim
  
 
=Configuration=
 
=Configuration=

Revision as of 22:24, 15 April 2009

Template:I18n links start Template:I18n entry Template:I18n entry Template:I18n entry Template:I18n entry Template:I18n links end

Introduction

SLiM is an acronym for Simple Login Manager (SLiM). SLiM is simple, lightweight and easily configurable allowing it be used on low and high end systems with relative ease. SLiM is also very convenient for those who want a login manager without the dependencies of Gnome or KDE making it perfect for users running Xfce, Openbox, Fluxbox, etc.

Installation

SLiM is available from the /extra repositories

# pacman -S slim

There is also a themes package

# pacman -S slim-themes

and an Archlinux theme

  1. pacman -S archlinux-themes-slim

Configuration

Enabling SLiM

Refer to Adding a login manager (KDM, GDM, or XDM) to automatically boot on startup.

Single Environments

To configure SLiM to load a particular environment, simply edit ~/.xinitrc to look like the following:

#!/bin/sh

#
# ~/.xinitrc
#
# Executed by startx (run your window manager from here)
#

exec [session-command]
  • Note: If you do not have have a ~/.xinitrc file, you can create one (with, for example, nano). By default slim expects to find such a file for all users and will complain it is "unable to process the login command" if no such file exists in the user's home directory.

Replace [session-command] with the appropriate session command. For example:

  • To launch Openbox: "exec openbox-session"
  • To launch Fluxbox: either "exec fluxbox" or "exec startfluxbox"
  • To launch Xfce: "exec startxfce4"
  • To launch GNOME: "exec gnome-session"
  • To launch KDE: "exec startkde"

If your environment is not listed here, refer to the documentation provided by your software.

Multiple Environments

If you require the ability to load 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 choose the session at login time by pressing F1. Note that this feature is experimental.

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

DEFAULT_SESSION=twm

case $1 in
kde)
	exec startkde
	;;
xfce4)
	exec startxfce4
	;;
icewm)
	icewmbg &
	icewmtray &
	exec icewm
	;;
wmaker)
	exec wmaker
	;;
blackbox)
	exec blackbox
	;;
*)
	exec $DEFAULT_SESSION
	;;
esac

Source for sample: http://svn.berlios.de/svnroot/repos/slim/trunk/xinitrc.sample

Slim documentation: http://slim.berlios.de/manual.php

Themes

Install the slim-themes package:

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

The archlinux-themes-slim packages contains several different themes. Check /usr/share/slim/themes to see the available variations and other themes available.

Edit the current_theme line in /etc/slim.conf from "default" to one of your choice:

# nano /etc/slim.conf
#current_theme       default
current_theme       archlinux-simplyblack

To preview a theme, run:

slim -p /usr/share/slim/themes/<theme name>

Tips & Tricks

Changing the cursor

If you don't like the "X" cursor and you want to change it to, for example, an arrow, use the slim-cursor package from AUR.

After installing, edit /etc/slim.conf and uncomment the line:

cursor   left_ptr

This will give you a normal arrow instead. This setting is forwarded to xsetroot -cursor_name. You can look up the possible cursor names here or in /usr/share/icons/<your-cursor-theme>/cursors/.

To change the cursor theme being used at the login screen, make a file named /usr/share/icons/default/index.theme with this content:

[Icon Theme]
Inherits=<your-cursor-theme>

Replace <your-cursor-theme> with the name of the cursor theme you want to use, e.g. whiteglass.

Slim and Desktop share a theme

A simple way of sharing wallpaper between Slim and your desktop is to create a symbolic link from your desktop wallpaper file to the default Slim theme:

# mv /usr/share/slim/themes/default/background.jpg /usr/share/slim/themes/default/background.old.jpg
# ln -s /path/to/mywallpaper.jpg /usr/share/slim/themes/default/background.jpg

Now your Slim theme and desktop wallpaper will be the same, smoothing the transition while loading the desktop. (Obviously you must keep the default theme setting in /etc/slim.conf for the above trick to work.)

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, enter the appropriate value 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))

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:

 sessionstart_cmd    /usr/bin/sessreg -a -l $DISPLAY %user
 sessionstop_cmd     /usr/bin/sessreg -d -l $DISPLAY %user

Setting DPI with 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 edit your slim.conf from:

 xserver_arguments   -nolisten tcp vt07 

to

 xserver_arguments   -nolisten tcp vt07 -dpi 96

Weblinks