window placement, resizing from command line

Hi,

I’m looking for a solution which would allow me to move and resize windows (e.g. rdesktop or firefox, etc…) in X. Preferably independent of either GNOME or KDE. The purpose of this is to be able to perform demo, where certain windows would be placed on a laptop’s external monitor, without the obvious mouse cursor movements and resizing.

Thanks,
Gábor

In good old Motif Windows manager there was the geometry parameter which was honoured by almost all X applications. As I could not find a similar thing for Konsole in KDE 4 >:(, I doubt that todays Windows managers have such a feature.

I hope somebody can prove me wrong :slight_smile:

yeah… however if I’m not mistaken, the -geometry parameter is a one-time affair; it only applies when the application is started. It seems to me, that the solution is related to the window manager’s capability to change a particular window’s size and position. I’m not sure what’s involved, but I don’t think that it should be too hard to achieve. After all every window manager does this when the user resizes or moves the window.

Seems that I can answer my own question… :slight_smile: xdotool does exactly what I need. While browsing for information on the Compiz site found this page Plugins/Dbus - Compiz Wiki which lists some nice options to interact with X and the Compiz window manager.

xdotool
xdotool lets you programatically (or manually) simulate keyboard input and
mouse activity, move and resize windows, etc. It does this using X11’s XTEST
extension and other Xlib functions.

Example:


    WID=`xdotool search --title "Mozilla Firefox"`  #1  
    xdotool windowmove $WID 1440 0                  #2  
    xdotool windowactivate $WID                  #3
    xdotool key --clearmodifiers F11                #4  

  1. Get window ID WID of Firefox
  2. Move window identified by WID
  3. Activate window
  4. send key F11 (full screen)

I think I’ll use this to make a small script, which I can bind to a key to move the active window to the external screen.

Get xdotool from the Contrib repository http://download.opensuse.org/repositories/openSUSE:/11.3:/Contrib/standard/

Of course -geometry only works at the start of the application. And you did ask for that imho, not for locking the resizing/moving of it after it is opened.

Henk, you’ve read the question wrong, I’m afraid. Thanks for replying anyway.

Quite possible. I think I needed a vacation.

And that is what I did. And that again is the reason it took a week to answer you. Sorry about that.

But as I understand you have a solution, my answer is not important any more. Enjoy!