SLiM configuration

Is it possible to get SLiM to run my .login script? I end up having to login within my term emulator to get my PATH set correctly. :\
 
You can set environment variables in ~/.xinitrc (or .xsession whichever is executed, I symlink them)
That's how I do this :D

EDIT:
Just thought of it, you can also include files in ~/.xinitrc
you can do that with
Code:
. /path/to/some/sh/script/to/include
 
Here's my ~/.xinitrc:
Code:
# Used for SLiM

DEFAULT=startlxde

xrdb .Xresources

CK="ck-launch-session dbus-launch --exit-with-session"

case $1 in
xfce4)
	exec ${CK} startxfce4
	;;
gnome)
	exec ${CK} gnome-session
	;;
lxde)
	exec ${CK} startlxde
	;;
amiwm)
	exec amiwm
	;;
kde4)
	exec ${CK} /usr/local/kde4/bin/startkde
	;;
*)
	exec ${CK} $DEFAULT
	;;
esac
 
both .xinitrc and .xsesssion :
Code:
#!/bin/sh
exec /usr/local/bin/windowmanager

Then .xsession should be made executable, so the login manager can use it.

I use slim's configuration files to choose the desktops.

/usr/local/share/xsessions/*.desktop file:
Code:
Name=*
Exec=/usr/local/bin/*
 
Hi,
both .xinitrc and .xsesssion :
Code:
#!/bin/sh
exec /usr/local/bin/windowmanager
Then .xsession should be made executable, so the login manager can use it.

This is an old post and the configuration method of x11/slim has changed, hence the differences between your solution (using /usr/local/share/xsessions) and the ones provided before. I have been using x11/slim during a while and I do not remember having done the quoted steps. Are you sure they are needed ? In my case, I was just using ~/.xinitrc file to set things such as keymap and wallpaper. For sure, I did not make them executable (I do not even have a ~/.xsession).
 
.xinitrc is normally used from the command line. Only .xsession has to be made executable; it is meant to be executed from the login manager, according to FreeBSD 6 unleashed. It seems like both files need to be like that for it to work. "windowmanager" would have to be replaced with the windowmanager chosen, and the full pathway may not be needed. It appears you ran slim and the window manager from .xinitrc alone?

The steps for selecting a desktop are in slim(1) and slim.conf. A deprecated option for selecting desktops is still displayed in slim.conf; but it shows the newer way to do it, by pointing to the directory for selecting the desktop.

For some odd reason, the way I do it, all three files point to the same window-manager redundantly for it to work. If you edit *.desktop as above, you'll notice the Name variable in the slim login screen.
 
It appears you ran slim and the window manager from .xinitrc alone?
I did not run x11/slim from ~/.xinitrc. I enabled it in /etc/rc.conf. By default, the xsessions folder was /usr/local/share/xsessions where x11-wm/i3 had already created a session file :
Code:
% pkg which /usr/local/share/xsessions/i3.desktop
/usr/local/share/xsessions/i3.desktop was installed by package i3-4.9
Then, I used graphics/feh to set my wallpaper on x11-wm/i3 with something like the following in my ~/.xinitrc (there is may be a smarter way to do it). :
Code:
if [ "$1" = "i3" ]
then
    feh --bg-fill ~/.i3/wallpapers/freebsd-binary.png
fi
That's it.
 
Oh. Slim can also be enabled through /etc/ttys, by changing the line from xdm to slim, and setting the option on. If the window manager doesn't take care of the background, then what you said is the way to do it. I find it odd that my set up didn't work unless I set up both .xsession and .xinitrc; and your set up didn't have .xsession, which is meant to be run from the login manager, unless i3 took care of it.
 
What windows manager do you use ? From the thread I gave you, it seems that some windows manager provide a default *.desktop file. I am sure for x11-wm/i3 and almost sure that's also the case for x11-wm/xfce4.
 
/usr/local/share/xsessions/jwm.desktop
Code:
[Desktop Entry]
Name=JWM
Exec=/usr/local/bin/jwm
[Desktop Entry] was missing, with this, /home/*/.xsession is not needed. I'll post the code at the other thread.

I use jwm
 
When I delete .xinitrc it fails to log in.

When I restored it and changed the exec line to twm, the desktop came up, but in a minimal way, so I moved it back to my default used desktop.
Code:
exec /usr/local/bin/*
 
So then, from the thread you showed me, I edited .xinitrc by removing exec /usr/local/bin/* and adding
exec $1 at the end
Code:
#!/bin/sh
exec $1
This is the minimum required .xinitrc file.
 
When I delete .xinitrc it fails to log in.
I don't think this is a good idea. As I told you, I used this file and this file is needed (as far as I understood) by x11/slim. I gave you the lines I had for the wallpaper, not the whole ~/.xinitrc file. As you can see from Thread how-to-configure-slim.48747, you also need a line with
Code:
exec $1
You should refer to this thread for a complete ~/.xinitrc file. If this can help you, here is the i3.desktop file provided by x11-wm/i3.
Code:
[Desktop Entry]
Name=i3
Comment=improved dynamic tiling window manager
Exec=i3
TryExec=i3
Type=Application
X-LightDM-DesktopName=i3
DesktopNames=i3

-- Edit --
You posted while I was writing... Exactly, but you don't need the shebang (at least, I don't have one).
 
Back
Top