Making an application window square, or choosing its width or height

Is it possible to make an application window square, or to choose its width or height?

This would be very useful for taking screenshot or screen recordings.

I'm running the Gnome edition of Zorin OS.

The resize of the window (by just click and drag from the edges) does not work for you?
Or you want to select the exact height and width for the window?

You can use the alt + F8 shortcut and then adjust the size with your arrow keys, that might be a good way?

I want to be able to make it an exact square, or to choose the exact dimensions

There are probably several methods none of them easy. And getting consistency would be a bit tedious, too.
As I am on Zorin OS lite, I could use an .xml file for the XFWM4 Window Manager.
On Gnome...
I would use wmctrl to get the window I.D., then xdotool to set that I.D. to the exact dimensions... However this would need to be performed Per Window and Every time a session is restarted. Not fun.
Some good with scripts may be able to write an automated script to do it (it would slow your login time a bit...)

Some apps allow for this built in - using the right click on the headerbar, then resize and set it (guesswork, not exact)... but it will remain as set.
This is partly due to the push for Client Side Decoration or CSD's... As the Client or Third Party Application is made responsible for the Window Management, instead of the Desktop Window Manager.
Which is why on XFCE 4.14, I can do so with an .xml file and apply it consistently and someone on Gnome cannot.

1 Like

I looked to wmctrl and to it working.


$ sudo apt-get update
$ sudo apt-get install wmctrl

Position and resize a window

# -r string: substring of the window's title
# -e left, up, width, height: coordinates of the upper left window's corner and window's dimensions
$ wmctrl -r string -e 0,left,up,width,height

for example:

$ wmctrl -r blender -e 0,100,100,1200,1200

You did that simpler than I would have. :wink:

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.