Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Do X progs signal when the window draws? [SOLVED: xwininfo]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
woodm
Tux's lil' helper
Tux's lil' helper


Joined: 18 Jun 2002
Posts: 75

PostPosted: Wed May 03, 2006 7:23 am    Post subject: Do X progs signal when the window draws? [SOLVED: xwininfo] Reply with quote

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
View user's profile Send private message
jk3us
Apprentice
Apprentice


Joined: 14 Mar 2005
Posts: 201
Location: Memphis, TN

PostPosted: Wed May 03, 2006 4:53 pm    Post subject: Reply with quote

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
View user's profile Send private message
woodm
Tux's lil' helper
Tux's lil' helper


Joined: 18 Jun 2002
Posts: 75

PostPosted: Wed May 03, 2006 7:12 pm    Post subject: that's HOT! Reply with quote

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
View user's profile Send private message
woodm
Tux's lil' helper
Tux's lil' helper


Joined: 18 Jun 2002
Posts: 75

PostPosted: Wed May 03, 2006 10:34 pm    Post subject: For the record... Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
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