View previous topic :: View next topic |
Author |
Message |
woodm Tux's lil' helper
Joined: 18 Jun 2002 Posts: 75
|
Posted: Wed May 03, 2006 7:23 am Post subject: Do X progs signal when the window draws? [SOLVED: xwininfo] |
|
|
Ok, this one is pretty trivial, but it's worth asking.
I use perlpanel, and I start several terms in my .xinitrc/.xsession file. quite often, the terms will be drawn to the screen before perlpanel is drawn, and thusly get placed behind my panel. Is there a way to make my .xsession waitt until perlpanel is drawn fully, before I create my terms?
I can imagine the syntax looking something like this:
Code: | perlpanel & panelid=$!
wait $panelid
aterm &
aterm &
... |
but clearly, that would fail, as my .xsession script would wait until perlpanel is completely finished (aka, killed) before I create my aterms. Is there any sort of signaling, or sig_status_request one can throw at normal X programs? _________________ There are thousands of types of people in this world:
The type that seperates people into two groups,
and the thousands of other types.
Last edited by woodm on Wed May 03, 2006 7:14 pm; edited 1 time in total |
|
Back to top |
|
|
jk3us Apprentice
Joined: 14 Mar 2005 Posts: 201 Location: Memphis, TN
|
Posted: Wed May 03, 2006 4:53 pm Post subject: |
|
|
This might work:
Code: |
perlpanel &
t=1
while [ $t != 0 ]
do
xwininfo -name "perlpanel" &>/dev/null # xwininfo can also give you the right name
t=$?
done
aterm &
aterm &
|
No guarantees here... That could easily loop forever (though seems to work for me) |
|
Back to top |
|
|
woodm Tux's lil' helper
Joined: 18 Jun 2002 Posts: 75
|
Posted: Wed May 03, 2006 7:12 pm Post subject: that's HOT! |
|
|
ooooh, I like that. I can even grep out the correct settings, and just make my aterms pop up in the right spot.
Thanks a ton. That's fantastic. _________________ There are thousands of types of people in this world:
The type that seperates people into two groups,
and the thousands of other types. |
|
Back to top |
|
|
woodm Tux's lil' helper
Joined: 18 Jun 2002 Posts: 75
|
Posted: Wed May 03, 2006 10:34 pm Post subject: For the record... |
|
|
Here's what I decided to go with, hopefully that will eliminate any possibility of an endless loop.
Code: | perlpanel 2> /dev/null & PANELID=$!
# Do other things that need to be done here to minimize potential waiting time.
while [ ! -z "`/usr/bin/env ps -p $PANELID -o comm=`" ] ; do
until [ ! -z "`xwininfo -name "perlpanel" 2> /dev/null`" ] ; do
sleep .1
done
break;
done
for a in `seq 1 6` ; do
aterm &
done
|
Thank you again for the xwininfo tip. I have been looking for that for a LONG time.
I started out stripping the geometry out of the xwininfo result, but it was just too cumbersome to actually apply that to information to multiple aterms. Since each Aterm doesn't necessarily in sequence, I'd have to grab the xwininfo from the last window to appear, who's name has changed because of my .bashrc ... it was more of a headache than was needed, especailly since openbox does a perfectly find job of putting windows where they need to go. _________________ There are thousands of types of people in this world:
The type that seperates people into two groups,
and the thousands of other types. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|