Skip to content

Instantly share code, notes, and snippets.

@worenga
Created September 6, 2013 12:18
Show Gist options
  • Save worenga/6463030 to your computer and use it in GitHub Desktop.
Save worenga/6463030 to your computer and use it in GitHub Desktop.
#! /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
}
lxterminal &
wait_for "xdotool search --onlyvisible --pid $! --name lxterminal"
i3-msg split h
lxterminal &
wait_for "xdotool search --onlyvisible --pid $! --name lxterminal"
i3-msg split v
lxterminal &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment