Race condition for startup applications?
I am using i3 version 4.7.2 (Debian Jessie) and am having problems getting programs to start up on appropriate workspaces. For the life of me, it looks like any program which has a delay between execution and start will end up on whatever workspace is selected when the window finally gets drawn. For instance, if I drop to the cli and run
i3-msg 'workspace number 1; exec google-chrome; workspace number 11; exec google-chrome'
I end up with workspaces 1 and 11 open, but 11 contains both instances of google-chrome (this works with other sets of programs too, like virtualbox and libreoffice).
The relevant parts of my actual config looks like this:
workspace 1 output VGA1
workspace 2 output VGA1
workspace 9 output VGA1
workspace 10 output VGA1
workspace 11 output HDMI1
workspace 19 output HDMI1
workspace 20 output HDMI1
exec i3-msg 'workspace number 1 "Chrome"; exec google-chrome'
exec i3-msg 'workspace number 2 "Chrome 2"; exec google-chrome'
exec i3-msg 'workspace number 11 "Chrome 3"; exec google-chrome'
exec i3-msg 'workspace number 9 "virtualbox"; exec virtualbox'
exec i3-msg 'workspace number 10 "log"; exec libreoffice --calc -o ~/Documents/Log.ods'
exec i3-msg 'workspace number 19 "banshee"; exec banshee'
exec i3-msg 'workspace number 20 "pidgin"; exec pidgin'
exec i3-msg 'workspace number 11; workspace number 1;
What I actually get is
Workspace 10 "log" is open on VGA1, but empty
Workspace 2 is open on HDMI1 and contains 3 google-chrome windows
Workspace 19 "banshee" is open on HDMI1 and contains virtualbox, libreoffice, banshee
Workspace 20 "pidgin" is open on HDMI1 and contains pidgin
Workspaces 1,9,11 are not present (presumably created and destroyed when switched away with nothing in).
I have tried using exec --no-startup-id i3-msg
on each line containg i3-msg above, but it just rearranges the jumble rather than sorting it out. I tried running multiple shell commands in just a few i3-msg commands, but again it just rearranges the jumble rather than sorting correctly.
It's worth noting that after i3 loads, if I drop to a command line and enter i3-msg 'workspace 5; exec google-chrome'
the new window opens in workspace 5, whereas if I enter i3-msg 'workspace 5; exec google-chrome; workspace number 2'
, I get the new chrome window in workspace 2.
Am I missing something? Is there some way to insert a pause between lines in the config file to give time for everything to load?