Michael Stapelberg <michael+i3@xxxxxxxxxxxxx> writes:
Excerpts from Frank Haun's message of 2012-01-28 23:35:08 +0000:
You can completely script such tasks. I use 'xdotool' for suchA better way than sending commands to X11 which sends them to i3 is to
jobs. Look your i3 config for the related keys to resize (shrink and
grow) windows.
directly execute i3 commands, for example with i3-msg. In your
example, you can use:
xdotool key Super_L+a # focus the parent containeri3-msg focus parent
#---------------------------------------------------#Hm, basically you could use the for_window configuration directive here:
wait_for () {
n=0
while true
do
if $1; then
break
else
# 20 seconds timeout
if [ $n -eq 20 ]; then
xmessage "Error executing: $1"
break
else
n=`expr $n + 1`
sleep 1
fi
fi
done
}
wait_for "xdotool search --name emacs"
#---------------------------------------------------#
for_window [class="emacs"] exec ~/.bin/my_script_for_emacs.sh
(I didn’t test whether emacs actually sets its class to 'emacs'.)
If you only want to have this match the first time such a window
appears you might want to some configuration file tricks, like keeping
the for_window directives in a separate file and your other
configuration in another file, then cat them together in your xsession
and after all your windows have appeared, only write your base
configuration to the config file and reload i3.