Difference between revisions of "SLiM"

From ArchWiki
Jump to: navigation, search
m (rw, being lightweight is not disputed, and already written in the intro below)
(use new templates, see Help:Style)
Line 22: Line 22:
 
=== Enabling SLiM ===
 
=== Enabling SLiM ===
  
SLiM can be loaded on startup by entering it in your daemons array in {{Filename|rc.conf}} or by modifying {{Filename|inittab}}. See [[Display Manager]] for detailed instructions.
+
SLiM can be loaded on startup by entering it in your daemons array in {{ic|rc.conf}} or by modifying {{ic|inittab}}. See [[Display Manager]] for detailed instructions.
  
 
=== Single environments ===
 
=== Single environments ===
  
To configure SLiM to load a particular environment, edit your {{Filename|~/.xinitrc}} to load your desktop environment:
+
To configure SLiM to load a particular environment, edit your {{ic|~/.xinitrc}} to load your desktop environment:
  
<pre>
+
{{bc|
 
#!/bin/sh
 
#!/bin/sh
  
Line 38: Line 38:
  
 
exec [session-command]
 
exec [session-command]
</pre>
+
}}
  
SLiM reads the local {{Filename|~/.xinitrc}} configuration and then launches the desktop according to what is in that file.  If you do not have a {{Filename|~/.xinitrc}} file, you can use the skeleton file by:
+
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 ~
 
  $ cp /etc/skel/.xinitrc ~
Line 48: Line 48:
 
   chmod +x ~/.xinitrc
 
   chmod +x ~/.xinitrc
  
Replace {{Codeline|[session-command]}} with the appropriate session command.  Some examples of different desktop start commands:
+
Replace {{ic|[session-command]}} with the appropriate session command.  Some examples of different desktop start commands:
  
<pre>
+
{{bc|
 
exec awesome
 
exec awesome
 
exec dwm
 
exec dwm
Line 62: Line 62:
 
exec enlightenment_start
 
exec enlightenment_start
 
exec ck-launch-session $ONE_OF_THE_ABOVE
 
exec ck-launch-session $ONE_OF_THE_ABOVE
</pre>
+
}}
  
 
To get automount to work it might be necessary to use something like e.g.:
 
To get automount to work it might be necessary to use something like e.g.:
Line 72: Line 72:
 
=== PolicyKit ===
 
=== PolicyKit ===
  
If you have problems with PolicyKit, use ConsoleKit's {{Codeline|ck-launch-session}} by changing the {{Codeline|login_cmd}} line of your {{filename|/etc/slim.conf}} to:
+
If you have problems with PolicyKit, use ConsoleKit's {{ic|ck-launch-session}} by changing the {{ic|login_cmd}} line of your {{ic|/etc/slim.conf}} to:
  
 
  login_cmd exec ck-launch-session /bin/bash -login ~/.xinitrc %session
 
  login_cmd exec ck-launch-session /bin/bash -login ~/.xinitrc %session
  
and leave your {{Filename|~/.xinitrc}} as plain as possible; for instance:
+
and leave your {{ic|~/.xinitrc}} as plain as possible; for instance:
  
 
  #!/bin/sh
 
  #!/bin/sh
Line 83: Line 83:
 
=== Autologin ===
 
=== Autologin ===
  
To make SLiM automatically login as a specified user (without having to type a password) the following lines in {{Filename|/etc/slim.conf}} should be changed.
+
To make SLiM automatically login as a specified user (without having to type a password) the following lines in {{ic|/etc/slim.conf}} should be changed.
 
  # default_user        simone
 
  # default_user        simone
  
Line 96: Line 96:
 
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 {{Filename|~/.xinitrc}} file and edit the sessions variable in {{Filename|/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 choose the session at login time by pressing F1.  Note that this feature is experimental.
  
<pre>
+
{{bc|1=
 
# The following variable defines the session which is started if the user doesn't explicitly select a session
 
# The following variable defines the session which is started if the user doesn't explicitly select a session
 
# Source: http://svn.berlios.de/svnroot/repos/slim/trunk/xinitrc.sample
 
# Source: http://svn.berlios.de/svnroot/repos/slim/trunk/xinitrc.sample
Line 126: Line 126:
 
;;
 
;;
 
esac
 
esac
</pre>
+
}}
 
   
 
   
 
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 *).
 
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 *).
Line 132: Line 132:
 
=== Themes ===
 
=== Themes ===
  
Install the {{Package Official|slim-themes}} package:
+
Install the {{Pkg|slim-themes}} package:
  
 
  # pacman -S slim-themes archlinux-themes-slim
 
  # pacman -S slim-themes archlinux-themes-slim
  
The {{Package Official|archlinux-themes-slim}} packages contains several different themes. Look in the directory of {{Filename|/usr/share/slim/themes}} to see the themes available.  Enter the theme name on the {{Codeline|current_theme}} line in {{Filename|/etc/slim.conf}}:
+
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}}:
  
 
  #current_theme      default
 
  #current_theme      default
Line 151: Line 151:
 
==== Dual screen setup ====
 
==== Dual screen setup ====
  
You can customize the slim theme in {{Filename|/usr/share/slim/themes/<your-theme>/slim.theme}} to turn these percents values. The box itself is 450 pixels by 250 pixels:
+
You can customize the slim theme in {{ic|/usr/share/slim/themes/<your-theme>/slim.theme}} to turn these percents values. The box itself is 450 pixels by 250 pixels:
  
 
  input_panel_x          50%
 
  input_panel_x          50%
Line 174: Line 174:
 
=== Changing the cursor ===
 
=== Changing the cursor ===
  
If you want to change the default X cursor to a newer design, the {{Package AUR|slim-cursor}} package is available.
+
If you want to change the default X cursor to a newer design, the {{AUR|slim-cursor}} package is available.
  
After installing, edit {{Filename|/etc/slim.conf}} and uncomment the line:
+
After installing, edit {{ic|/etc/slim.conf}} and uncomment the line:
  
 
  cursor  left_ptr
 
  cursor  left_ptr
  
This will give you a normal arrow instead. This setting is forwarded to {{Codeline|xsetroot -cursor_name}}. You can look up the possible cursor names [http://cvsweb.xfree86.org/cvsweb/*checkout*/xc/lib/X11/cursorfont.h?rev=HEAD&content-type=text/plain here] or in {{Filename|/usr/share/icons/<your-cursor-theme>/cursors/}}.
+
This will give you a normal arrow instead. This setting is forwarded to {{ic|xsetroot -cursor_name}}. You can look up the possible cursor names [http://cvsweb.xfree86.org/cvsweb/*checkout*/xc/lib/X11/cursorfont.h?rev=HEAD&content-type=text/plain here] or in {{ic|/usr/share/icons/<your-cursor-theme>/cursors/}}.
  
To change the cursor theme being used at the login screen, make a file named {{Filename|/usr/share/icons/default/index.theme}} with this content:
+
To change the cursor theme being used at the login screen, make a file named {{ic|/usr/share/icons/default/index.theme}} with this content:
  
 
  [Icon Theme]
 
  [Icon Theme]
Line 200: Line 200:
 
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 {{Filename|/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)
 
* For shutdown, enter '''halt''' as the username
 
* For shutdown, enter '''halt''' as the username
 
* For reboot, enter '''reboot''' as the username
 
* For reboot, enter '''reboot''' as the username
 
* To exit to bash, enter '''exit''' 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 {{Filename|/etc/slim.conf}} as root to uncomment the {{codeline|suspend_cmd}} line and, if necessary modify the suspend command itself (e.g. change {{Codeline|/usr/sbin/suspend}} to {{Codeline|sudo /usr/sbin/pm-suspend}}))
+
* For suspend, enter '''suspend''' as the username (suspend is disabled by default, edit {{ic|/etc/slim.conf}} as root to uncomment the {{ic|suspend_cmd}} line and, if necessary modify the suspend command itself (e.g. change {{ic|/usr/sbin/suspend}} to {{ic|sudo /usr/sbin/pm-suspend}}))
  
 
=== SLiM init error with rc.d daemon ===
 
=== SLiM init error with rc.d daemon ===
  
If you initialize SLiM with {{Filename|/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 {{Filename|/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 {{Filename|/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 /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 214: Line 214:
 
=== 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 {{Filename|/etc/slim.conf}} and {{Filename|/etc/splash.conf}}; set the {{Codeline|1=DEFAULT_TTY=7}} same as {{Codeline|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 ===
  
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 {{Filename|/etc/slim.conf}} as follows:
+
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 {{ic|/etc/slim.conf}} as follows:
 
  sessionstart_cmd /path/to/tray/icon/program &
 
  sessionstart_cmd /path/to/tray/icon/program &
  
 
=== Login information with SLiM ===
 
=== 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 {{Filename|slim.conf}} as follows:
+
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 {{ic|slim.conf}} as follows:
  
 
   sessionstart_cmd    /usr/bin/sessreg -a -l $DISPLAY %user
 
   sessionstart_cmd    /usr/bin/sessreg -a -l $DISPLAY %user
Line 229: Line 229:
  
 
=== 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 {{Filename|/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 [http://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
  
You also have to add to {{Filename|/etc/pam.d/passwd}}:
+
You also have to add to {{ic|/etc/pam.d/passwd}}:
 
  password        optional        pam_gnome_keyring.so
 
  password        optional        pam_gnome_keyring.so
  
 
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 {{Filename|/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 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 [http://bugs.archlinux.org/task/18930 here]. Modifying the {{Codeline|login_cmd}} line in {{Filename|/etc/slim.conf}}:
+
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}}:
 
  login_cmd exec ck-launch-session dbus-launch /bin/bash -login ~/.xinitrc %session >~/.xsession-errors 2>&1
 
  login_cmd exec ck-launch-session dbus-launch /bin/bash -login ~/.xinitrc %session >~/.xsession-errors 2>&1
  
As of GNOME 3, simply adding {{Codeline|dbus-launch}} after {{Codeline|ck-launch-session}} will work, without needing to edit {{Filename|/etc/pam.d/slim}}.
+
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.1, you need to add {{Codeline|dbus-launch}} after {{Codeline|ck-launch-session}} and edit {{Filename|/etc/pam.d/{slim,passwd} }}, 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.
+
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 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].
  
 
If you have problems keeping the keyring unlocked for longer sessions, there is another thing that Gnome does:  
 
If you have problems keeping the keyring unlocked for longer sessions, there is another thing that Gnome does:  
Look at {{Filename|/etc/xdg/autostart/{gnome-keyring-gpg.desktop, gnome-keyring-pkcs11.desktop, gnome-keyring-secrets.desktop, gnome-keyring-ssh.desktop}}}.  
+
Look at {{ic|<nowiki>/etc/xdg/autostart/{gnome-keyring-gpg.desktop, gnome-keyring-pkcs11.desktop, gnome-keyring-secrets.desktop, gnome-keyring-ssh.desktop}</nowiki>}}.  
  
 
Append the following lines to .xinitrc just before you start your wm (example here is awesome wm):
 
Append the following lines to .xinitrc just before you start your wm (example here is awesome wm):
Line 264: Line 264:
  
 
=== SLiM and Environment Variables ===
 
=== 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 {{Filename|/etc/environment}} and sets up the environment accordingly.
+
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: {{Codeline|startxfce4}}, Unicode characters on my terminal works fine.
+
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 {{Filename|/etc/environment}} or your user specific file: {{Filename|$HOME/.pam_environment}}:
+
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.
 
  # You can change these to fit your preference, of course.
 
  LANG="en_US.UTF-8"
 
  LANG="en_US.UTF-8"
 
  LC_COLLATE="C"
 
  LC_COLLATE="C"
  
Alternatively, you can modify the line in {{Filename|/etc/pam.d/slim}} from:
+
Alternatively, you can modify the line in {{ic|/etc/pam.d/slim}} from:
<pre>
+
{{bc|session required pam_env.so}}
session required pam_env.so
+
</pre>
+
 
To:
 
To:
<pre>
+
{{bc|1=session required pam_env.so envfile=<yourfile>}}
session required pam_env.so envfile=<yourfile>
+
</pre>
+
 
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.
 
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 {{Filename|/etc/X11/xinit/xserverrc}} it will not work with SLiM. To fix this change your {{Filename|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 295: Line 291:
 
=== Use a random theme ===
 
=== Use a random theme ===
  
Use the {{Codeline|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===
 
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)
 
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 {{Filename|/etc/slim.conf}} file. Just a few lines down you should see:
+
So, to move the X-Server you need to change one number in the {{ic|/etc/slim.conf}} file. Just a few lines down you should see:
 
  xserver_arguments -nolisten tcp vt07
 
  xserver_arguments -nolisten tcp vt07
  
Line 317: Line 313:
 
! Option Name || Default Value
 
! Option Name || Default Value
 
|-
 
|-
| default_path ||{{Codeline|/bin:/usr/bin:/usr/local/bin}}
+
| default_path ||{{ic|/bin:/usr/bin:/usr/local/bin}}
 
|-
 
|-
| default_xserver ||{{Codeline|/usr/bin/X}}
+
| default_xserver ||{{ic|/usr/bin/X}}
 
|-
 
|-
| xserver_arguments ||{{Codeline|vt07 -auth /var/run/slim.auth}}
+
| xserver_arguments ||{{ic|vt07 -auth /var/run/slim.auth}}
 
|-
 
|-
 
| numlock ||
 
| numlock ||
 
|-
 
|-
| daemon || {{Codeline|yes}}
+
| daemon || {{ic|yes}}
 
|-
 
|-
| xauth_path ||{{Codeline|/usr/bin/xauth}}
+
| xauth_path ||{{ic|/usr/bin/xauth}}
 
|-
 
|-
| login_cmd ||{{Codeline|exec /bin/bash -login ~/.xinitrc %session}}
+
| login_cmd ||{{ic|exec /bin/bash -login ~/.xinitrc %session}}
 
|-
 
|-
| halt_cmd ||{{Codeline|/sbin/shutdown -h now}}
+
| halt_cmd ||{{ic|/sbin/shutdown -h now}}
 
|-
 
|-
| reboot_cmd ||{{Codeline|/sbin/shutdown -r now}}
+
| reboot_cmd ||{{ic|/sbin/shutdown -r now}}
 
|-
 
|-
 
| suspend_cmd ||
 
| suspend_cmd ||
Line 341: Line 337:
 
| sessionstop_cmd ||
 
| sessionstop_cmd ||
 
|-
 
|-
| console_cmd ||{{Codeline|/usr/bin/xterm -C -fg white -bg black +sb -g %dx%d+%d+%d -fn %dx%d -T }}
+
| console_cmd ||{{ic|/usr/bin/xterm -C -fg white -bg black +sb -g %dx%d+%d+%d -fn %dx%d -T }}
 
|-
 
|-
| screenshot_cmd ||{{Codeline|import -window root /slim.png}}
+
| screenshot_cmd ||{{ic|import -window root /slim.png}}
 
|-
 
|-
| welcome_msg ||{{Codeline|Welcome to %host}}
+
| welcome_msg ||{{ic|Welcome to %host}}
 
|-
 
|-
| session_msg ||{{Codeline|Session:}}
+
| session_msg ||{{ic|Session:}}
 
|-
 
|-
 
| default_user ||
 
| default_user ||
 
|-
 
|-
| focus_password ||{{Codeline|no}}
+
| focus_password ||{{ic|no}}
 
|-
 
|-
| auto_login ||{{Codeline|no}}
+
| auto_login ||{{ic|no}}
 
|-
 
|-
| current_theme ||{{Codeline|default}}
+
| current_theme ||{{ic|default}}
 
|-
 
|-
| lockfile ||{{Codeline|/var/run/slim.lock}}
+
| lockfile ||{{ic|/var/run/slim.lock}}
 
|-
 
|-
| logfile ||{{Codeline|/var/log/slim.log}}
+
| logfile ||{{ic|/var/log/slim.log}}
 
|-
 
|-
| authfile ||{{Codeline|/var/run/slim.auth}}
+
| authfile ||{{ic|/var/run/slim.auth}}
 
|-
 
|-
| shutdown_msg ||{{Codeline|The system is halting...}}
+
| shutdown_msg ||{{ic|The system is halting...}}
 
|-
 
|-
| reboot_msg ||{{Codeline|The system is rebooting...}}
+
| reboot_msg ||{{ic|The system is rebooting...}}
 
|-
 
|-
| sessions ||{{Codeline|wmaker,blackbox,icewm}}
+
| sessions ||{{ic|wmaker,blackbox,icewm}}
 
|-
 
|-
 
| sessiondir ||
 
| sessiondir ||
 
|-
 
|-
| hidecursor ||{{Codeline|false}}
+
| hidecursor ||{{ic|false}}
 
|-
 
|-
| input_panel_x ||{{Codeline|50%}}
+
| input_panel_x ||{{ic|50%}}
 
|-
 
|-
| input_panel_y ||{{Codeline|40%}}
+
| input_panel_y ||{{ic|40%}}
 
|-
 
|-
| input_name_x ||{{Codeline|200}}
+
| input_name_x ||{{ic|200}}
 
|-
 
|-
| input_name_y ||{{Codeline|154}}
+
| input_name_y ||{{ic|154}}
 
|-
 
|-
| input_pass_x ||{{Codeline|-1}}
+
| input_pass_x ||{{ic|-1}}
 
|-
 
|-
| input_pass_y ||{{Codeline|-1}}
+
| input_pass_y ||{{ic|-1}}
 
|-
 
|-
| input_font ||{{Codeline|1=Verdana:size=11}}
+
| input_font ||{{ic|1=Verdana:size=11}}
 
|-
 
|-
| input_color ||{{Codeline|#000000}}
+
| input_color ||{{ic|#000000}}
 
|-
 
|-
| input_cursor_height ||{{Codeline|20}}
+
| input_cursor_height ||{{ic|20}}
 
|-
 
|-
| input_maxlength_name ||{{Codeline|20}}
+
| input_maxlength_name ||{{ic|20}}
 
|-
 
|-
| input_maxlength_passwd ||{{Codeline|20}}
+
| input_maxlength_passwd ||{{ic|20}}
 
|-
 
|-
| input_shadow_xoffset ||{{Codeline|0}}
+
| input_shadow_xoffset ||{{ic|0}}
 
|-
 
|-
| input_shadow_yoffset ||{{Codeline|0}}
+
| input_shadow_yoffset ||{{ic|0}}
 
|-
 
|-
| input_shadow_color ||{{Codeline|#FFFFFF}}
+
| input_shadow_color ||{{ic|#FFFFFF}}
 
|-
 
|-
| welcome_font ||{{Codeline|1=Verdana:size=14}}
+
| welcome_font ||{{ic|1=Verdana:size=14}}
 
|-
 
|-
| welcome_color ||{{Codeline|#FFFFFF}}
+
| welcome_color ||{{ic|#FFFFFF}}
 
|-
 
|-
| welcome_x ||{{Codeline|-1}}
+
| welcome_x ||{{ic|-1}}
 
|-
 
|-
| welcome_y ||{{Codeline|-1}}
+
| welcome_y ||{{ic|-1}}
 
|-
 
|-
| welcome_shadow_xoffset ||{{Codeline|0}}
+
| welcome_shadow_xoffset ||{{ic|0}}
 
|-
 
|-
| welcome_shadow_yoffset ||{{Codeline|0}}
+
| welcome_shadow_yoffset ||{{ic|0}}
 
|-
 
|-
| welcome_shadow_color ||{{Codeline|#FFFFFF}}
+
| welcome_shadow_color ||{{ic|#FFFFFF}}
 
|-
 
|-
 
| intro_msg ||
 
| intro_msg ||
 
|-
 
|-
| intro_font ||{{Codeline|1=Verdana:size=14}}
+
| intro_font ||{{ic|1=Verdana:size=14}}
 
|-
 
|-
| intro_color ||{{Codeline|#FFFFFF}}
+
| intro_color ||{{ic|#FFFFFF}}
 
|-
 
|-
| intro_x ||{{Codeline|-1}}
+
| intro_x ||{{ic|-1}}
 
|-
 
|-
| intro_y ||{{Codeline|-1}}
+
| intro_y ||{{ic|-1}}
 
|-
 
|-
| background_style ||{{Codeline|stretch}}
+
| background_style ||{{ic|stretch}}
 
|-
 
|-
| background_color ||{{Codeline|#CCCCCC}}
+
| background_color ||{{ic|#CCCCCC}}
 
|-
 
|-
| username_font ||{{Codeline|1=Verdana:size=12}}
+
| username_font ||{{ic|1=Verdana:size=12}}
 
|-
 
|-
| username_color ||{{Codeline|#FFFFFF}}
+
| username_color ||{{ic|#FFFFFF}}
 
|-
 
|-
| username_x ||{{Codeline|-1}}
+
| username_x ||{{ic|-1}}
 
|-
 
|-
| username_y ||{{Codeline|-1}}
+
| username_y ||{{ic|-1}}
 
|-
 
|-
| username_msg ||{{Codeline|Please enter your username}}
+
| username_msg ||{{ic|Please enter your username}}
 
|-
 
|-
| username_shadow_xoffset ||{{Codeline|0}}
+
| username_shadow_xoffset ||{{ic|0}}
 
|-
 
|-
| username_shadow_yoffset ||{{Codeline|0}}
+
| username_shadow_yoffset ||{{ic|0}}
 
|-
 
|-
| username_shadow_color ||{{Codeline|#FFFFFF}}
+
| username_shadow_color ||{{ic|#FFFFFF}}
 
|-
 
|-
| password_x ||{{Codeline|-1}}
+
| password_x ||{{ic|-1}}
 
|-
 
|-
| password_y ||{{Codeline|-1}}
+
| password_y ||{{ic|-1}}
 
|-
 
|-
| password_msg ||{{Codeline|Please enter your password}}
+
| password_msg ||{{ic|Please enter your password}}
 
|-
 
|-
| msg_color ||{{Codeline|#FFFFFF}}
+
| msg_color ||{{ic|#FFFFFF}}
 
|-
 
|-
| msg_font ||{{Codeline|1=Verdana:size=16:bold}}
+
| msg_font ||{{ic|1=Verdana:size=16:bold}}
 
|-
 
|-
| msg_x ||{{Codeline|40}}
+
| msg_x ||{{ic|40}}
 
|-
 
|-
| msg_y ||{{Codeline|40}}
+
| msg_y ||{{ic|40}}
 
|-
 
|-
| msg_shadow_xoffset ||{{Codeline|0}}
+
| msg_shadow_xoffset ||{{ic|0}}
 
|-
 
|-
| msg_shadow_yoffset ||{{Codeline|0}}
+
| msg_shadow_yoffset ||{{ic|0}}
 
|-
 
|-
| msg_shadow_color ||{{Codeline|#FFFFFF}}
+
| msg_shadow_color ||{{ic|#FFFFFF}}
 
|-
 
|-
| session_color ||{{Codeline|#FFFFFF}}
+
| session_color ||{{ic|#FFFFFF}}
 
|-
 
|-
| session_font ||{{Codeline|1=Verdana:size=16:bold}}
+
| session_font ||{{ic|1=Verdana:size=16:bold}}
 
|-
 
|-
| session_x ||{{Codeline|50%}}
+
| session_x ||{{ic|50%}}
 
|-
 
|-
| session_y ||{{Codeline|90%}}
+
| session_y ||{{ic|90%}}
 
|-
 
|-
| session_shadow_xoffset ||{{Codeline|0}}
+
| session_shadow_xoffset ||{{ic|0}}
 
|-
 
|-
| session_shadow_yoffset ||{{Codeline|0}}
+
| session_shadow_yoffset ||{{ic|0}}
 
|-
 
|-
| session_shadow_color ||{{Codeline|#FFFFFF}}
+
| session_shadow_color ||{{ic|#FFFFFF}}
 
|}
 
|}
  
== Resources ==
+
== 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 11:40, 23 November 2011

This template has only maintenance purposes. For linking to local translations please use interlanguage links, see Help:i18n#Interlanguage links.


Local languages: Català – Dansk – English – Español – Esperanto – Hrvatski – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Norsk Bokmål – Polski – Português – Slovenský – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – العربية – ไทย – 日本語 – 正體中文 – 简体中文 – 한국어


External languages (all articles in these languages should be moved to the external wiki): Deutsch – Français – Română – Suomi – Svenska – Tiếng Việt – Türkçe – فارسی

Summary help replacing me
Provides an overview of the Simple Login Manager.
Related
Display Manager
Note: SLiM is outdated and upstream development has ceased. Please consider using LXDM instead of SLiM. You can find information on setting up LXDM on the Display Manager page. SLiM is still a good and functional Display Manager, but it is not clear how the situation will evolve in future.

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.

Installation

Install SLiM from the extra repository:

# pacman -S slim

Configuration

Enabling SLiM

SLiM can be loaded on startup by entering it in your daemons array in rc.conf or by modifying inittab. See Display Manager for detailed instructions.

Single environments

To configure SLiM to load a particular environment, edit your ~/.xinitrc to load your desktop environment:

#!/bin/sh

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

exec [session-command]

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

$ cp /etc/skel/.xinitrc ~

Remember to make .xinitrc executable:

 chmod +x ~/.xinitrc

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

exec awesome
exec dwm
exec startfluxbox
exec fvwm2
exec gnome-session
exec openbox-session
exec startkde
exec startlxde
exec startxfce4
exec enlightenment_start
exec ck-launch-session $ONE_OF_THE_ABOVE

To get automount to work it might be necessary to use something like e.g.:

exec ck-launch-session dbus-launch startxfce4

If your environment is not listed here, refer to the appropriate wiki page.

PolicyKit

If you have problems with PolicyKit, use ConsoleKit's ck-launch-session by changing the login_cmd line of your /etc/slim.conf to:

login_cmd exec ck-launch-session /bin/bash -login ~/.xinitrc %session

and leave your ~/.xinitrc as plain as possible; for instance:

#!/bin/sh
exec startxfce4 # or the window manager of your choice

Autologin

To make SLiM automatically login as a specified user (without having to type a password) the following lines in /etc/slim.conf should be changed.

# default_user        simone

Uncomment this line, and change "simone" to the user to be logged into automatically.

# auto_login          no

Uncomment this line and change the 'no' to 'yes'. This enables the auto login feature.

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 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
# Source: http://svn.berlios.de/svnroot/repos/slim/trunk/xinitrc.sample

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

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 *).

Themes

Install the slim-themes package:

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

The archlinux-themes-slim packages contains several different themes. 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:

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

To close, type "exit" in the Login line and press Enter.

Additional theme packages can be found in the AUR.

Dual screen setup

You can customize the slim theme in /usr/share/slim/themes/<your-theme>/slim.theme to turn these percents values. The box itself is 450 pixels by 250 pixels:

input_panel_x           50%
input_panel_y           50%

into pixels values:

# These settings set the "archlinux-simplyblack" panel in the center of a 1440x900 screen
input_panel_x           495
input_panel_y           325
# These settings set the "archlinux-retro" panel in the center of a 1680x1050 screen
input_panel_x           615
input_panel_y           400

If your theme has a background picture you should use the background_style setting ('stretch', 'tile', 'center' or 'color') to get it correctly displayed. Have a look at the very simple and clear official documentation about slim themes for further details.

Other options

A few things you might like to try.

Changing the cursor

If you want to change the default X cursor to a newer design, the slim-cursorAUR package is available.

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).

Match SLiM and Desktop Wallpaper

To share a wallpaper between SLiM and your desktop, rename the used theme background, then create a link from your desktop wallpaper file to the default SLiM theme:

# mv /usr/share/slim/themes/default/background.jpg{,.bck}
# ln -s /path/to/mywallpaper.jpg /usr/share/slim/themes/default/background.jpg

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:

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

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).

auth       optional    pam_gnome_keyring.so
session    optional    pam_gnome_keyring.so    auto_start

You also have to add to /etc/pam.d/passwd:

password        optional        pam_gnome_keyring.so

If you use a screensaver you also have to add

auth    optional        pam_gnome_keyring.so

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:

login_cmd exec ck-launch-session dbus-launch /bin/bash -login ~/.xinitrc %session >~/.xsession-errors 2>&1

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

As of GNOME 3.1, you need to add dbus-launch after ck-launch-session and edit /etc/pam.d/{slim,passwd}, 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 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):

/usr/bin/gnome-keyring-daemon --start --components=gpg
/usr/bin/gnome-keyring-daemon --start --components=pkcs11
/usr/bin/gnome-keyring-daemon --start --components=secrets
/usr/bin/gnome-keyring-daemon --start --components=ssh
/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.

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.

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 /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: startxfce4, Unicode characters on my terminal works fine.

This can be fixed by adding this to /etc/environment or your user specific file: $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 /etc/pam.d/slim from:

session		required	pam_env.so

To:

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

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.

Automatically mount your encrypted /home on login

You can use pam_mount.

All Slim Options

Here is a list of all the slim configuration options and their default values.

Note: welcome_msg allows 2 variables %host and %domain
sessionstart_cmd allows %user (execd right before login_cmd) and it is also allowed in sessionstop_cmd
login_cmd allows %session and %theme

See also