Results 1 to 7 of 7

Thread: window placement, resizing from command line

  1. #1
    Join Date
    Jul 2008
    Location
    Netherlands
    Posts
    28

    Default 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,
    Gbor

  2. #2
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    24,872

    Default Re: window placement, resizing from command line

    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
    Henk van Velden

  3. #3
    Join Date
    Jul 2008
    Location
    Netherlands
    Posts
    28

    Default Re: window placement, resizing from command line

    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.

  4. #4
    Join Date
    Jul 2008
    Location
    Netherlands
    Posts
    28

    Default Re: window placement, resizing from command line

    Seems that I can answer my own question... :-) 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:
    Code:
        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/reposit...trib/standard/

  5. #5
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    24,872

    Default Re: window placement, resizing from command line

    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 van Velden

  6. #6
    Join Date
    Jul 2008
    Location
    Netherlands
    Posts
    28

    Default Re: window placement, resizing from command line

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

  7. #7
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    24,872

    Default Re: window placement, resizing from command line

    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!
    Henk van Velden

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •