2019-12-02 18:43:07 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
# Wait for program coming up
|
|
|
|
wait_for_program() {
|
|
|
|
n=0
|
|
|
|
while true; do
|
|
|
|
# PID of last background command
|
|
|
|
if xdotool search --onlyvisible --pid $! 2>/dev/null; then
|
|
|
|
break
|
|
|
|
else
|
|
|
|
if [ $n -eq 200 ]; then
|
|
|
|
notify-send -u critical "Error during start: last program $! did not started fast enough"
|
|
|
|
break
|
|
|
|
else
|
|
|
|
n=$($n + 1)
|
|
|
|
sleep 0.1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2019-12-02 20:14:39 +00:00
|
|
|
i3-msg "workspace number 2"
|
2019-12-02 18:43:07 +00:00
|
|
|
alacritty &
|
|
|
|
wait_for_program
|
|
|
|
|
2019-12-02 20:14:39 +00:00
|
|
|
i3-msg "workspace number 10"
|
2019-12-02 18:43:07 +00:00
|
|
|
spotify &
|
|
|
|
wait_for_program
|
|
|
|
|
2019-12-02 18:50:54 +00:00
|
|
|
i3-msg "workspace number 9"
|
|
|
|
keybase &
|
|
|
|
wait_for_program
|
|
|
|
|
2019-12-02 20:14:39 +00:00
|
|
|
i3-msg "workspace number 1"
|
2019-12-02 18:43:07 +00:00
|
|
|
qutebrowser &
|
|
|
|
wait_for_program
|
|
|
|
|
|
|
|
i3-msg "workspace number 3"
|