I asked a related, but more specific, question here. I want to know if there is a way to specify where you want a program to launch. I basically want to write a shell script which is launched every time I log in, like so
google-chrome www.gmail.com -workspace=1 -monitor=1
google-chrome www.facebook.com -workspace=1 -monitor=2
google-chrome www.youtube.com -workspace=1 -monitor=3
gedit a.txt b.txt c.txt -workspace=2 -monitor=1
gedit d.txt e.txt f.txt -workspace=2 -monitor=2
gedit g.txt h.txt i.txt -workspace=2 -monitor=3
mplayer Terminator1.mkv -workspace=3 -monitor=1
mplayer Terminator2.mkv -workspace=3 -monitor=2
mplayer Terminator3.mkv -workspace=3 -monitor=3
there is a program called wmctrl but it fails in so many ways that I don't even know where to begin. In principle it is simple, specify the window, and move it. But specifying windows is not easy, two browsers are both named the same "Google Chrome". One can use their unique window IDs, but getting this information is not trivial (AFAIK, this is not returned upon execution). Then there is an :ACTIVE:
option which is the most recently launched program, but there is no guarantee that the window is launched when control is returned to the command line. To make matters worse, one must specify global coordinates, as opposed to optional coordinates within a workspace/monitor.
Here is the approach I am currently taking. I have uploaded some scripts to GitHub (see here or here) which use wmctrl to move windows around.