I've got three omnibus books containing 9 total Warhammer 40,000 stories.  Before I mention which ones I've got, which book would you recommend as a good place to start the series?


Question: How can I open a window on a different monitor?
Answer: No, you can't do that directly. In the X architecture, the two physical monitors you see are not discernible by applications. You can only work your way around this abstraction, by determining which areas of the visible workspace correspond to which monitor and then place windows at the correct offset.

Sensible toolkits support a -geometry option, which allows your application to request being placed at a specific position. If you don't have this option available, you can use wmctrl if you have an EWMH/NetWM compatible X Window Manager to move and resize already existing windows (see wmctrl (1), you need options -r and -e). I use devilspie to force placement of some windows and of course your window manager of choice may have its own facility to force window placement.

devilspie allows to apply certain actions on X windows and can use X window properties to discern different windows and applications. The key rule for you would be geometry "&lt;width&gt;x&lt;height&gt;+&lt;xoffset&gt;+&lt;yoffset&gt;".

Yet, you always need to do the calculations of when and where another physical monitor begins yourself. But this is not too hard and xrandr does tell you how and where it uses monitors in the form of "&lt;width&gt;x&lt;height&gt;+&lt;xoffset&gt;+&lt;yoffset&gt; on each line staring with an output name.

There is not the foolproof-it-will-just-work way, because implementations may (and do!) vary. wmctrl usually works on the window title to identify the target. devilspie can also refer to its class, yet, I am not aware of any toolkit that lets you specify a X windows class but not its geometry.

Of course you could always start two xephyr instances and make one fill your left screen and the other your right screen and then address screens via the DISPLAY environment variable, but this solution has other downsides.

In theory, the authority to govern window placement is the window manager. Consequently, if you want stuff your window manager can't to, it will be hacky and it's also the reason why there is no generic way to accomplish this.

Yet, if your concrete use case is your android emulator ... which is very different from asking for the option to specify SCREEN=n fooapp on the shell, then devilspie may be what you are looking for. Hint: I found it's best to identify applications by their window class.