Good evening Betram et al.

I've read the discussion thread as far as it went and would like
to share my own solution to a similar problem, mapped onto the
sh topic. Maybe it works.

A little background:

First of all, because my standard dialog shell is the system's
C shell, the files important are /etc/cshrc with the settings,
such as setenv, alias and path, furthermore /etc/csh.login to
be executed after login, and /etc/csh.logout, executed after
logout. Local to the user exist ~/.cshrc, ~/.login and ~/.logout
which are used if present.

In order to make X work properly with these settings, I have
a kind of "two stages mechanism" which consists of the files
~/.xinitrc and ~/.xsession. The first one is used by X (xdm)
to determine what to do after successful user login, e. g.
start some programs and then exec the window manager / desktop

Note that both files are chmodded executable:

        % ll .xsession .xinitrc
        -rwxr-xr-x  1 poly  pgm  807 Mar  3 02:46 .xinitrc*
        -rwxr-xr-x  1 poly  pgm   43 Apr 27  2006 .xsession*

The ~/.xsession doesn't do anything besides first incorporate
settings from ~/.cshrc and then execute ~/.xinitrc.

        source ~/.cshrc
        exec ~/.xinitrc

It is shebanged with the shell I want to use, which is the C shell.

If ~/.xsession is called, it's last action is to execute ~/.xinitrc.
If ~/.xsession is NOT called, ~/.xinitrc will be executed anyway.
It does the following:

        [ -f ~/.xmodmaprc ] && xmodmap ~/.xmodmaprc
        xrandr --size 1400x1050 &
        xrandr --fb 1400x1050 &
        xsetroot -solid rgb:3b/4c/7a

        # ... your initializations 'n stuff here ...

        exec wmaker

Note that this script is shebanged for sh again. Any X terminals
started now (with csh inside) have the settings from ~/.cshrc.

Mapped onto the initial sh problem, I'd suggest to create the
two files mentioned as follows:


        [ -f ~/.shrc ] && . ~/.shrc
        [ -f ~/.profile ] && . ~/.profile
        exec ~/.xinitrc


        [ -f ~/.shrc ] && . ~/.shrc
        [ -f ~/.profile ] && . ~/.profile
        exec my_wm_startup

Now any instance of sh started should be aware of the settings.

Finally, please note that I'm not a guru for sh (or bash) because
I do use sh only for scripting, and bash never. :-)

>From Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
_______________________________________________ mailing list
To unsubscribe, send any mail to ""

Reply via email to