starting KDE?

I know that there has been a million discussion topics on starting KDE or GNOME but I have edited my .xinitrc file in my home directory to:
source /sw/bin/init.sh
/sw/bin/startkde >/tmp/kde.log 2>&1
and it just makes my xdarwin automatically quit. If I try to manualy start kde through the xterm by typing "startkde" it says that there is no such command. I have also tried to edit my .xinitrc file to several other things that people have said to do and nothing works at all. The only way that I can get XDarwin to start and run is by having an .xinitrc file that reads:
#!/bin/sh
# $Xorg: xinitrc.cpp,v 1.3 2000/08/17 19:54:30 cpqbld Exp $

userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/usr/X11R6/lib/X11/xinit/.Xresources
sysmodmap=/usr/X11R6/lib/X11/xinit/.Xmodmap

# merge in defaults and keymaps

if [ -f $sysresources ]; then
xrdb -merge $sysresources
fi

if [ -f $sysmodmap ]; then
xmodmap $sysmodmap
fi

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

if [ -f $usermodmap ]; then
xmodmap $usermodmap
fi

# start some nice programs

twm &
xclock -geometry 50x50-1+1 &
xterm -geometry 80x50 49451 &
xterm -geometry 80x20+494-0 &
exec xterm -geometry 80x66 00 -name login

I have had trouble trying to get kde for some time now. For a while, I was having trouble compiling kde through fink because fink couldn't connect to any mirrors. I was able to get through the compile process today or at least that is what I think because after compiling for a while, I get a message at the bottom of fink commander saying, "done" but it is not saying "current" in the status column. Does anyone know how I could check to see if I have it? I am very confused right now, I am pulling my hair out trying to figure this out. On my desktopp running 10.3 I was able to just install kde through fink, edit my .xinitrc file and I was starting kde without a problem. Now when I try and put it on my ibook, first I have trouble finding it through fink, then I have trouble getting dependencies through fink, then I have trouble with the mirrors and now I'm stuck on the .xinitrc file (thats even if I have installed kde properly at all). I have no hair left to pull out anymore! Can someone please help me?

p.s. Bill Scott, I have followed all of the directions on your site, can you tell me what that was?

--Matt

Dual 1ghz G4 MDD, iBook 12" 1.33 mhz, iBook 12" 800 mhz, Mac OS X (10.3.9), OS X 10.4 on 1.33ghz iBook and OS X 10.3.9 on 800mhz iBook

Posted on Dec 10, 2005 9:43 PM

Reply
9 replies

Dec 11, 2005 3:11 PM in response to airspoon

Hi Matt,
You need to read the documentation about the "exec" shell builtin command (in the shell man page) before playing with the ~/.xinitrc script. It can only be used in the last command in the script because it replaces the current process with whatever you tell it to invoke. Thus, control never returns from such a call and anything you put after it is never executed.

X11 uses this mechanism in an interesting way. It essentially "execs" the ~/.xinitrc script so that script is, for a short period of time, the main X11 process. If that script returns, X11 dies. Thus, not only must the exec command be last, it must be there to pass control of X11 to another application. In your working example, you pass control of X11 to an xterm. Therefore, if you close that xterm, X11 will quit, which isn't what you want.

Usually, we "exec" the window or desktop manager in the last command. Thus, I think that what you want is a last line that is something like:

exec /sw/bin/startkde

--
Gary
~~~~
Backward conditioning:
Putting saliva in a dog's mouth in an attempt
to make a bell ring.

Dec 12, 2005 6:24 AM in response to Thierry6

Hi Thierry,
I wasn't saying that it doesn't work. I don't use KDE so there are plenty of things I don't know about it. Is it it's own window manager or do you also run a window manager? What do you exec in your ~/.xinitrc?

If that's what's recommended then definitely include the redirection of output to the log. That's why I said "something like ...". I wasn't trying to dictate the form of the startkde part of the line. I was only suggesting that it be "execed". That way, when you logout of KDE, X11 quits, which is why the writers of X11 substituted the execution of the xinitrc script for the main process. You certainly wouldn't want X11 to quit when you exited an xterm.

I apologize for not discussing the flexibility of process. Explaining the need for the "exec" command is a fairly lengthy discourse already and I didn't want to write a book. However, it is still necessary to have an "exec" command at the end of the xinitrc and the reasons I gave for what to "exec" are still valid. You could certainly exec a window manager instead of KDE but I would think that you'd want KDE to have control over whether X11 is running.

Of course the situation is more flexible with Mac OS X because there are other ways of stopping X11, like with the menu. On other flavors of UNIX, when you logout of KDE, you probably want to logout of the computer altogether. The command I provided is essentially what is used on Red Hat Linux if Gnome isn't installed so I didn't just make it up. Anyway, I hope the explanation of how the xinitrc works benefits some.
--
Gary
~~~~
Never let your schooling interfere with your education.

Dec 12, 2005 7:26 AM in response to Gary Kerbaugh

I know orders of magnitude less than Gary about this, but if he would permit me to summarize what I think are the main points, then

1. The last line has to be an exec command. (Exec basically says take this new process and substitute it for the current one.)

2. The process that exec is switching you to would presumably be the new window manager (it should not be an xterm process).

3. You don't want to run the exec command in the background (no & sign at the end of the command).

Dec 22, 2005 4:23 AM in response to David Fass

Well, you could install all of the SDKs on the developer cd, then install fink, then install XDarwin which works great with KDE (mind you, it may take a couple of days for all this to compile), and I thought I heard that KDE can't work with Apple's X11 (?). Right now I have KDE 3.4 & XDarwin installed via fink and it works as though I was on a Linux or pure UN*X machine. Of course I have to recompile everything that came from a Linux kernel, but if it came from UN*X (PPC) then it seems to work fine w/o recompiling.

MacMini G4 1.25 GHz 512 RAM, Mac OS X (10.4.2), Mac OS X (10.3.9) Dual-Boot

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

starting KDE?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.