Re: [i3] Predefined Layouts

  • From: Frank Haun <fh@xxxxxxxx>
  • To: Discussions/Questions about the i3 window manager <i3-discuss@xxxxxxxxxxxxx>
  • Date: Wed, 25 Apr 2012 18:54:19 +0200

Marcelo Cerri <mhcerri@xxxxxxxxx> writes:

Using "--pid" instead of "--classname" for xdotool may solve the
problem for terminals:

#! /bin/sh

# Wait for program
wait_for () {
echo wait
n=0
while true
do
if $1; then
break
else
# 10 seconds timeout
if [ $n -eq 100 ]; then
xmessage "Error on: $1"
break
else
n=`expr $n + 1`
sleep .1
fi
fi
done
sleep 1
}

urxvt &
wait_for "xdotool search --onlyvisible --pid $!"
i3-msg split h
urxvt &
wait_for "xdotool search --onlyvisible --pid $!"
i3-msg split v
urxvt &

Hehe, that sounds very good. I must improve my shell knowledge.

http://steve-parker.org/sh/quickref.shtml
$! PID of last background command

Yep, something I was looking for. I'll test it and then I update my
example.

Thanks a lot,
Frank

Other related posts: