1

I have a python script which starts a new instance in a new terminal window every minute using xterm (see below). I am running solaris with the Java desktop that has multiple desktops(?), if working on a different desktop the new terminal appears when I would like it to appear on the desktop where the script is intially run. I am sure the answer would be an xterm command but can't find it anywhere!

import sys, os, subprocess, time

i = 1

args = ['xterm', '-e', 'python2.6', 'script.py']

x = int(sys.argv[1])

while i <= x:
        subprocess.Popen(args)
        i += 1
        time.sleep(60)
kungphil
  • 11
  • 1

1 Answers1

0

I'm having trouble tracking down links to better explanations, but it is my understanding that the X protocol does not make it easy for a window manager to determine which desktop should get a new window when the "command" to start a new window originates from outside the window manager.

For example, your window manager may provide a toolbar that starts programs and knows which desktop it is on, and can then tell the window manager which desktop to use when the new client window is rendered. But if some other application on the system starts a window without knowing the desktop and without knowing a mechanism to communicate to the window manager which window to expect and which desktop to use, it'll just go onto the "active" desktop instead.

Some window managers allow you to specify some hints on window class or name. (Run xprop(1), click on a client, to see some of the window manager hints available.)

For example:

If your window manager makes it easy to match new client windows with different properties and move them where you wish, then you can use xterm(1)'s -class command line option to override the resource class if the -e window name is not sufficient for your needs.

sarnold
  • 102,305
  • 22
  • 181
  • 238