I was wondering if, in XFCE (my laptop is older and Unity is slow) it is possible to resize windows to exact pixel amounts?

e.g. Let's say I want a 501x504px window. Is this possible? Even if the command line is needed.

I need exact sizes for some training videos where I want to capture some windows.



From UbuntuForums.org:

Re: How to precisely resize windows in XFCE?

xdotool will allow you to resize windows on the fly. For example, to resize an existing Mousepad window to 400x400 pixels:

xdotool windowsize $(xdotool search --name "Mousepad" | tail -1) 400 400

If you want to start a program with a specific size, you can use the --geometry or -g parameters if the application supports them, or use a tool like devilspie.

Running the xdotool command worked perfectly. I just substituted Mousepad with whatever the name of the application was.

If you want to select the target window interactively, you can combine the two xdotool window commands windowsize and selectwindow:

xdotool selectwindow windowsize 800 600

In the past, I've used wmctrl to achieve this. The only downside is you have to use the command line to make changes. The old article I used to reference is broken, here is a new reference: Resizing windows to a particular width and height instantly


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.