Re: HOME as ~ in default PATH inherited from /etc/login.conf doesn't work for tcsh
- In reply to: Jackie : "Re: HOME as ~ in default PATH inherited from /etc/login.conf doesn't work for tcsh"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 19 Oct 2023 06:18:17 UTC
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, ...