Re: [i3] Predefined Layouts

  • From: Marcelo Cerri <mhcerri@xxxxxxxxx>
  • To: "Discussions/Questions about the i3 window manager" <i3-discuss@xxxxxxxxxxxxx>
  • Date: Wed, 25 Apr 2012 13:21:06 -0300

Hi Frank,

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 &


On Wed, Apr 25, 2012 at 12:37 PM, Frank Haun <fh@xxxxxxxx> wrote:

Marcelo Cerri <mhcerri@xxxxxxxxx> writes:

#v+
i3-msg split h  && \
i3-msg exec urxvt && \
i3-msg exec urxvt  && \
i3-msg split v  && \
i3-msg exec urxvt
#v-

Have you tried something similar to this approach?

https://github.com/fhaun/config-misc/blob/master/i3-stuff/auto-start-for-i3-simple

Ah yeah, from me. ;-) Unfortunately this doesn't work if the programs
have all the same class name. For several Terminals I prefer tmux
sessions.

Frank

Other related posts: