6

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.

Thanks!

etsnyman
  • 1,125

2 Answers2

4

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
David Foerster
  • 36,264
  • 56
  • 94
  • 147
etsnyman
  • 1,125
2

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

jacobfogg
  • 263
  • 1
  • 2
  • 6