Re: Root tail and heavy background pixmap

Henning Percy (
Tue, 22 Sep 1998 12:34:55 +0100 (BST)

On Tue, 22 Sep 1998, Francis GALIEGUE wrote:

> What I'd like to know is if it's possible for rt to wait for the
> background to get loaded, or if I have to play with sleep?
	Using 'ps' and 'awk' you could get the process id of the program that's
loading your background and then use the 'wait' shell command to wait for that
PID. Just look at 'man wait' it should explain most of it. 

	Here's a quick go at the script. I can't guarentee it'll work though:
	I assume that you use 'xv' to load your background and that the process
id is the second thing (hence the $2) that is listed when you do a 'ps'. I also
assume c-shell.

-----=[ Begin script snippet ]=-----
	xv -options background.xpm

	set my_pid = `ps awx | grep xv | grep -v grep | awk '{print $2}'`

	if( my_pid != "" )then 	
	#xv hasn't finished
		wait $my_pid


-----=[ End script snippet ]=-----

	Hope this helps, or at least gives you some ideas.

	Adler. (