Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Oct 2023 08:18:17 +0200
From:      Polytropon <freebsd@edvax.de>
To:        Jackie <jiangjun12321@yahoo.com>
Cc:        FreeBSD-questions@FreeBSD.org
Subject:   Re: HOME as ~ in default PATH inherited from /etc/login.conf doesn't work for tcsh
Message-ID:  <20231019081817.89c623e2.freebsd@edvax.de>
In-Reply-To: <cf526d48-f7e7-4c6e-80b7-8d0389fb8763@email.android.com>
References:  <cf526d48-f7e7-4c6e-80b7-8d0389fb8763.ref@email.android.com> <cf526d48-f7e7-4c6e-80b7-8d0389fb8763@email.android.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 18 Oct 2023 19:32:13 +0800, Jackie wrote:
> Ok so this is very interesting. I did two different tests.
> 
> First I pkg install slim and XDM as my login managers / display managers.
> I did not have a ~/.xinitrc file so slim just say failed to execute login
> command.

In case the C shell is your login shell, and you use a
display manager (or "text mode" login first, then "startx"),
the following approach might be helpful:

First, ~/.xsession:

	#!/bin/csh
	source ~/.cshrc
	exec ~/.xinitrc

This will obviously source your user-local settings for
the C shell, as well as those that might already be global
in /etc/csh.cshrc, in where I have this:

	set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin /opt/bin $HOME/bin)

However, using ~/bin istead of $HOME/bin should also work.

Then, in ~/.xinitrc, put your actual X initialization
commands, like this:

	#!/bin/sh
	[ -f ~/.xmodmaprc ] && xmodmap ~/.xmodmaprc
	numlockx
	xsetroot -solid rgb:3b/4c/7a
	xset b 100 1000 15 &
	xset r rate 250 30 &
	xset s off &
	xset -dpms &
	exec wmaker

The last line, starting with "exec", easily determines
which window manager or desktop environment you want.
If you need localized keyboard settings, use a X config
file in /usr/local/etc/X11/xorg.conf.d/ for this, so it
will be in effect no matter which window manager or desktop
environment you are using (except of course it knows better
than you and overrides your global setting because stupid).

Advantage: The X session will pick up your C shell settings,
no matter how it will be started, and you don't need to
have to maintain two "synchronized" X startup files.

I'm using this for decades (with xdm). The #! lines aren't
actually neccessary, but they tell you what "language" the
files are written in. ;-)

Disadvantage: This is C shell specific and does _not_
work for other shells you might use interactively or
as login shell (such as sh, bash, zsh, ksh).



-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20231019081817.89c623e2.freebsd>