4

How can I change the size of an x11 window with a script, be it AppleScript or otherwise. I have a process running using wine which is using XQuartz as the windowing system and I want to force the x11 window to a particular size.

7
  • Can't you just run xterm -geometry 72x35 ...?
    – nohillside
    Commented Mar 8, 2019 at 14:15
  • @nohillside the program in question is launched with wine and then must be resized after launched. It is an oldschool game running at 800x600 and I want to set it to 1600x1200. Editing the registry doesn't work, editing the virtual desktop size in wine doesn't work. It always forces itself back to 800x600 so I want to see if I can force the window size on the host machine, for that I need to resize an already running x11 window so I cannot use -geometry.
    – tsujp
    Commented Mar 8, 2019 at 14:23
  • Can you enlarge it manually by dragging the corner? Does the content (the game) resize accordingly if you do?
    – nohillside
    Commented Mar 8, 2019 at 14:30
  • @nohillside there are no handles to complete a resize
    – tsujp
    Commented Mar 8, 2019 at 14:32
  • XQuartz does not support scripting by AppleScript. Commented Mar 8, 2019 at 14:46

1 Answer 1

2

You can install Homebrew and use it to install wmctrl using the following command:

  brew install wmctrl

Then run wmctrl like this:

wmctrl -l

It should give you a list of all the available windows on screen. Take the ID for the game window and run:

wmctrl -i -r windowid -e 0,0,0,1600,1200

where windowid should be replaced with the ID of that window.

Note: I don't think your mission is likely to succeed, as most programs that do not offer resize handles are not able to handle resizing their windows at all. You'll probably end up with the contents being the same size as always, and then just a white/black color for the rest of the enlarged window. But it is worth a try!

2
  • I did indeed get the white/black colour background. The game has a fullscreen option though so I'm stumped as to why I cannot trick it to think that fullscreen is "x,y" dimensions.
    – tsujp
    Commented Mar 9, 2019 at 8:54
  • Depending on exactly how they have chosen to implement fullscreen it might be possible - but in general games tend to have this not-so-flexible system. The game might offer an in-game options screen to decide which resolution to have in full screen? I guess you have already tried that.
    – jksoegaard
    Commented Mar 9, 2019 at 10:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .