SLiM: lightweight display manager


by ross at 09:10:33 on December 17, 2017


# cd /usr/ports/x11/slim
# make install clean

Optionally check PAM. You need it if you are going to use Kerberos authentication. Default pam.d file for slim just includes system. So enable pam_krb5 in /etc/pam.d/system if you need Kerberos.

Enable SLiM

There are two ways you can start SLiM: using rc.conf file or from /etc/ttys. With the latest nVidia driver (319.32) tty method will not work anymore, so we will launch it by adding to /etc/rc.conf:


Make sure you don't switch text modes using allscreens_flags of rc.conf (or you'll lose your text consoles).


Modern SLiM uses session files in /usr/local/share/xsessions (create this directory). An example of a session file:

[Desktop Entry]
Name=KDE 4

Save it as /usr/local/share/xsessions/kde4.desktop

Exec parameter of session file is then passed to the .xinitrc script. So you use something like this as your ~/.xinitrc:

export __GL_YIELD="USLEEP"
nvidia-settings -l
exec $1

Put whatever you need to init the system in the beginning of the file and then just do exec $1.


Note: This is second version of my theme, it is usable in multi-monitor configuration


# cd /usr/local/share/slim/themes
# fetch
# tar jxvf slim-freebsd.tar.bz2
# rm slim-freebsd.tar.bz2

More themes could be found at SLiM site.

Edit /usr/local/etc/slim.conf, set theme (either 1680x1050 or 1920x1080 variant):

#current_theme       default
current_theme       freebsd-1680x1050


Nice theme. Thanks!
-- nick
Wednesday, September 16, 2015, 22:58:02
1. I did: pkg install slim
2. I followed the remaining instructions as above.
3. I got the "login screen" after reboot.
4. After I entered my user name and password, a blank dark scree appeared.
5. I rebooted, but I got the same blank screen.

What went wrong? Please help.
-- Jay
Friday, February 19, 2016, 14:52:42
Have you created .xinitrc in your home?
-- ross
Saturday, February 20, 2016, 13:16:20
I have the same result
-- andros
Monday, September 24, 2018, 13:12:44
Ok, when i looked at /var/log/slim.log i saw errors about dbus.
While dbus service is not necessary for lumina it is essential for SLIM :(
So after adding dbus_enable="YES" in rc.conf SLIM starts lumina without any problems.
-- andros
Monday, September 24, 2018, 15:40:06
Great theme! Thanks for putting this up.
-- Eric
Thursday, June 9, 2016, 17:37:28 doesn't have any A record.

Best wishes,
-- k0nsl
Thursday, September 29, 2016, 2:06:56
Very good any guide of this page, hopefully always to remain available to all. Maybe a guide to set up and customize Xfce?
-- aor
Monday, April 17, 2017, 8:54:39
the problem that I have with slim is, that it does not read the /etc/profile file or any local .profile file that exist in my home directory. Although the keyboard is set correctly in the console, it does not work correctly in the slim login screen.

If I login the system without slim enabled and start Xorg by using the command startx everything is perfect. Language is set correctly and restart and shutdown buttons work.
If I go the way, described in your tutorial shutdown and reboot are not available for me.

Any suggestions how to solve this problems?
-- Mike Otto Nahrgang
Friday, April 27, 2018, 20:16:08