views:

117

answers:

2

In Windows I would like to be able to run a script or application that starts an another application and sets its size and location. An example of this would be to run an application/script that starts notepad and tells it to be 800x600 and to be in the top right corner. Does anyone have any ideas regardless of language?

A: 

Do you mean something like this:

$ xterm -geometry 135x35+0+0

which puts an xterm at the top-left of the screen (+0+0) and makes it 135 columns by 35 lines? Most X apps take a -geometry argument with the same syntax (though often in pixels, not characters like xterm), and you can obviously put that in a shell script.

Alternatively, if the program is already running, the xwit command can be used to move it:

xwit -move 0 0 -columns 135 -id $WINDOWID

That will move the xterm its running in to the top-left corner of the screen, and make it 135 columns wide. It works on any window, not just xterms. For example:

xwit -move 0 0 -id 0x6600091

just moved my browser window. You can find window IDs with xwininfo, xlsclients, or several others.

derobert
That looks like it is for a UNIX OS (is this correct?) I edited the question after you posted to specify the OS. Thanks though for the quick response.
asawilliams
Well, its actually any X Window system setup, which usually — but not always — means a Unix variant. No idea how to do this on Windows, but hopefully this answer will be useful to someone...
derobert
A: 

Some OSs or desktops allow to set the size and location of a window in a config dialog, for example KDE.

Aaron Digulla