From owner-freebsd-questions Tue Mar 27 4:20:16 2001 Delivered-To: freebsd-questions@freebsd.org Received: from ash25.adelaide.on.net (ash25.internode.on.net [203.16.214.248]) by hub.freebsd.org (Postfix) with ESMTP id 7F41637B718 for ; Tue, 27 Mar 2001 04:20:12 -0800 (PST) (envelope-from imoore@picknowl.com.au) Received: from picknowl.com.au ([150.101.144.154]) by internode.on.net (PMDF V6.0-24 #37831) with ESMTP id <01K1PG14WX1M00INW6@internode.on.net> for freebsd-questions@FreeBSD.ORG; Tue, 27 Mar 2001 21:48:33 +0930 Date: Tue, 27 Mar 2001 21:49:09 +0930 From: Ian Moore Subject: .xsession errors with multiple window managers To: "freebsd-questions@FreeBSD.ORG" Message-id: <3AC0853D.D2D64DCC@picknowl.com.au> MIME-version: 1.0 X-Mailer: Mozilla 4.73 [en] (X11; I; Linux 2.2.12 i386) Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit X-Accept-Language: en Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi, I'm running fbsd 4.1-Release & I'm having trouble trying to get Xsession/.xsession configured to allow me to choose a window manager from the kdm login screen (I belive I'd have exactly the same problem if I was using xdm, though I haven't tried). My Xsession file looks like: #!/bin/sh -xv for errfile in "$HOME/.xsession-errors" "${TMPDIR-/tmp}/xses-$USER" "/tmp/xses-$USER" do if ( cp /dev/null "$errfile" 2> /dev/null ) then chmod 600 "$errfile" exec > "$errfile" 2>&1 break fi done case $# in 1) case $1 in failsafe) exec xterm -geometry 80x24-0-0 ;; esac esac startup=$HOME/.xsession resources=$HOME/.Xresources if [ -f "$startup" ]; then exec "$startup $1" else if [ -f "$resources" ]; then xrdb -load "$resources" fi exec xsm fi This should pick up the $1 parameter passed to it by kdm and then pass that on to .xsession which looks like (for root): #!/bin/sh -xv #set default wm to kde defaultwm=kde #set the window manager to $1 if it was supplied windowmgr=${1:-$defaultwm} #start the respective window managers case ${windowmgr} in kde|kwm|kdestart) WINDOWMANAGER=startkde ;; fvwm|fvwm2) WINDOWMANAGER=fvwm2 ;; *) WINDOWMANAGER=windowmgr # default for unknown wm's esac exec $WINDOWMANAGER but when I log in as root, it just goes back to the login screen. (Xsession & .xsession are both executable). The contents of .xsession-errors is: + break case $# in 1) case $1 in failsafe) exec xterm -geometry 80x24-0-0 ;; esac esac startup=$HOME/.xsession + startup=/root/.xsession resources=$HOME/.Xresources + resources=/root/.Xresources if [ -f "$startup" ]; then exec "$startup $1" else if [ -f "$resources" ]; then xrdb -load "$resources" fi exec xsm fi + [ -f /root/.xsession ] + exec /root/.xsession fvwm exec: /root/.xsession fvwm: not found The last line seems to imply that exec does not understand /root/.session fvwm correctly. If I edit Xsession and remove $1 from the line exec "$startup $1" and change the last line of .xsession to exec startkde or exec fvwm, it loads kde or fvwm correctly. Also, if I run sh .xsession kde from an xterm, it runs .xsession & loads kde correctly. So why does it not work if .xsession kde is exec'ed from Xsession ? I'm very confused by this - any help would be greatly appreciated. Cheers, Ian Moore To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message