Hi LL,
the .xinitrc file <strong>HAS</strong> to be an executable script. You can't run it if it isn't. It may be in any language, though people use simple shell scripts. It isn't any simple file containing app names. Xsession checks if the +x bit is set before running the script. It doesn't try to guess what language the .xinitrc file is written. You should mention that explicitly ( the shebang line is _MUST_ ).


I am sending a sample .xinitrc I picked up from somewhere on the net last year (had modified it to work for me). Adjust accordingly. Googling helps a lot on this topic.

-----------------BOF----------------------------------

#!/bin/sh

userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
xclients=$HOME/.Xclients

if [ -f $userresources ]; then
    xrdb -merge $userresources
fi
if [ -f $usermodmap ]; then
    xmodmap $usermodmap
fi

xterm +sb -fg green -bg black -C -geometry 45x6-200+8 -fn 6x13 -name console &
# other programs add here


ARG=$1
DEFAULTWM="startkde"

if [ ! $ARG ]; then
        ARG=$DEFAULTWM
fi

elif [ $ARG = "kde" ]; then
        WM=startkde
if [ $ARG = "gnome" ]; then
        WM=gnome-session
elif [ $ARG = "after" ]; then
        WM=afterstep
elif [ $ARG = "wm" ]; then
        WM=wmaker
elif [ $ARG = "ice" ]; then
        WM=icewm
else
        WM=$DEFAULTWM
fi


#finally, run the window manager, and redirect the stdout #and stderr to the file wm_out for debugging purposes

exec $WM >& ~/wm_out

------------------EOF-----------------------------------

now, all you have to do is type "startx kde" at the prompt to launch kde wm. Similarly for others. If you boot to runlevel 5, it will launch your default window manager. Remember that when you exit your window manager, X ends. So basically the last line in .xinitrc has to hang as long as you want your X session.

Now there's a catch where certain settings are overridden after you start the window manager. To avoid this, use similar code in .xinitrc::

-----shell code starts------

WM & pid_wm=$!

xterm &
xmms &
.......
.......

wait pid_wm
#do clean-up if necessary

-----shell code ends------

What the code does is that it runs the window manager, saves the pid of the process, then runs your programs. Finally it waits on the wm process. When you kill the wm, your X session ends.

Affly,
Bhaskar



On Sat, 20 Sep 2003 linuxlingam wrote :
dear bhaskar,

<you wrote>:
Hi LL,

 Have u chmodded the executable bit of .xinitrc file?
The /etc/X11/xdm/Xsession checks this before running
the user's xinitrc script.

Also, xdm uses the .xsession file instead. So try
symlinking the file:
ln -s .xinitrc .xsession
***

before i get into another twisted spin of checking out various
permutations,
is the .xinitrc file supposed to be a shell script, with the
#!/usr/bin/bash line as the first line and the relevant commands following,
with the file chmodded to execute,


or

is it supposed to be a plain file containing the application names and
scriptnames to launch, and the .xinitrc file chmodded to execute.


?

LL

___________________________________________________ Television meets Accounts; Jyoti Weds Rajaram. Rediff Matchmaker strikes another interesting match !! Visit http://matchmaker.rediff.com?1


_______________________________________________ ilugd mailing list [EMAIL PROTECTED] http://frodo.hserus.net/mailman/listinfo/ilugd

Reply via email to