Couple of days ago I decided to throw away GDM as login manager for my laptop and to install SLiM, a simple and nice independent graphical login manager for X11. Installing was easy as always thanks to the great job of the port maintainers.
Enabling SLiM in FreeBSD is as easy as appending slim_enable=”YES” to your /etc/rc.conf file.
To change the default theme all you have to do is download another SLiM Theme and unpack it in /usr/local/share/slim/themes. Then edit your configuration file /usr/local/etc/slim.conf to point to your favorite theme and you can enjoy it on next reboot. Remember, if you used another login manager like gdm, kdm or xdm then disable them in rc.conf.
Now here comes the tricky part.
The default login command in slim.conf says:
login_cmd exec /bin/sh - ~/.xinitrc %session
In this command the dash ‘-‘ you see after /bin/sh indicates that it is considered a login shell. As far as I know this would first read /etc/profile and then ~/.profile. Well, for whatever reason, it doesn’t
I noticed this behaviour when trying to update the ports tree, I got “portsnap: command not found”. Investigating this turned out that my $PATH was different then normal and finally I noticed this was because of /bin/sh not reading my .profile when logging in with SLiM.
For a workaround I changed the login command in slim.conf to use zsh:
login_cmd exec /usr/local/bin/zsh -l ~/.xinitrc %session
This still doesn’t read the .profile but rather .zprofile according to the zsh man pages, so I just copied and renamed .profile to .zprofile
As this also executes .xinitrc I added this to my .xinitrc
This will make xfce4 start up in my native language dutch and then I am ready to rock