Other Problems with SLIM and /bin/tcsh shell

Hello, I seem to be having problems setting up Slim with a default shell of ‘tcsh ‘.

In the Slim /usr/local/etc/slim.conf file there is a line that sets the ‘login_cmd’ to pass the chosen Slim window manager ( %session ) through to the login script, i.e., exec /bin/sh - ~/.xinitrc %session . There is also a commented line if the user‘s shell is the Bash shell; there is, however, no example for the /bin/tcsh shell.

It’s simple enough to provide one but with the tcsh shell it seems one cannot pass an argument to the login because -l may be the only flag according to the manual.

I found other posts on this subject but can‘t find one that states the solution other than moving to Bash or other work around.

Is there a direct approach to configuring Slim with tcsh ?

Many thanks
 
~/.xinitrc is started with the sh(1) shell.

Code:
#!/bin/sh

DEFAULTWM= awesome

[ -f "${HOME}/.Xresources" ] && xrdb "${HOME}/.Xresources"

if [ -z "$1" ]; then
        # Fallback
        exec ck-launch-session dbus-launch --exit-with-session urxvt
fi

case $1 in
        default) exec ck-launch-session ${DEFAULTVM}
        ;;
        *) exec "$@"
        ;;
esac
 
Are you perhaps having problems logging in?

If that's the case, it has nothing to do with the (tcsh(1)) (login?) shell. You need to specify a window manager (or a desktop environment) in the ~/.xinitrc shell script. i.e.
Code:
exec openbox-session

Other, sophisticated, examples see SirDices ~/.xinitrc or /usr/local/etc/X11/xinit/xinitrc.

The .xinitrc shell script is executed by xinit(1) (hence the name) to start programs after logging in and initializing the X window system when executed from command line directly or with the help of the startx(1) front end.

xinit(1)
Code:
       If no specific client program is given on the command line, xinit will
       look for a file in the user's home directory called .xinitrc to run as
       a shell script to start up client programs.  If no such file exists,
       xinit will use the following as a default:

            xterm  -geometry  +1+1  -n  login  -display  :0

When the Slim display manager is running the X window system is up and running but no user has logged in yet, so the .xinitrc script has no effect. It needs to be executed after logging in from Slim (hence the name login_cmd).
 
Ok, well I'm a little confused then. Slim seems to be configured from the file /usr/local/etc/slim.conf. In that file is the login command defined as follows with a note above it, i.e.,
Code:
# NOTE: if your system does not have bash you need
# to adjust the command according to your preferred shell,
# i.e. for freebsd use:
login_cmd      exec /bin/sh - ~/.xinitrc %session
# login_cmd    exec /bin/bash -login ~/.xinitrc % session
Now I would like to use the /bin/tcsh shell for my login user (non-root) and thus perceive that I need to adjust the command to something like the following:
Code:
login_cmd     exec  /bin/tcsh -l ~/.xinitrc %session

But of course this does not work as the '-l' can be the only flag. So the question is how do you run this if you choose to use the /bin/tcsh shell for your (non-root) user.

My ~/.xinitrc file is a copy of the /usr/local/etc/X11/xinit/xintrc file with the bottom of the file adjusted like so:
Code:
# twm &
# xclock -geometry 50x50-1+1 &
# xterm -geometry 80x50+494+51 &
# xterm -geometry 80x20+494-0 &
# exec xterm -geometry 80x66+0+0 -name login
exec "$1"
In this fashion the passed in "$1" is, for example 'i3' (or any other window manager you choose).

I guess the question another way, is; given that a login user is on a 'tcsh' shell is it ok for the login_cmd to be executed as a /bin/sh shell. This is where my confusion lies - I admit it is a newbie question ... but I am trying to learn the correct way to do these things.

When the Slim display manager is running the X window system is up and running but no user has logged in yet, so the .xinitrc script has no effect. It needs to be executed after logging in from Slim (hence the name login_cmd).
precisely, so as the user logs in (with a tcsh shell) surely the login_cmd should use the tcsh definition....?

many thanks...
 
Now I would like to use the /bin/tcsh shell for my login user (non-root)
Your user's shell is irrelevant here.

thus perceive that I need to adjust the command to something like the following:
No, you don't touch that line, at all. Just leave it as login_cmd exec /bin/sh - ~/.xinitrc %session. The shell being used here has nothing to do with the shell that's configured on your user account.

In this fashion the passed in "$1" is, for example 'i3' (or any other window manager you choose).
Doesn't work for SLiM. It may work for some window managers but not all. Mainly because some actually send more than one argument to ~/.xinitrc. And, if you don't make a selection, SLiM sends a literal "default" as $1.

Just copy/paste the ~/.xinitrc I posted above and adjust DEFAULTWM to your liking.
 
I personally like SDDM... but if you get one login manager working right, then it's just a matter of installing another, and switching to it:

In /etc/rc.conf, find the line that says sddm_enable=yes, and edit it to slim_enable=yes, and reboot (Well, there are other ways that I'm leaving out for brevity) :p
 
Back
Top