Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Resizing a window to a set size in Linux

Tags:

linux

Anyone knows a good way to resize any window to for example 640x480?

Reason is, of course, screencasting.

Under windows I've used ZoneSize from donationcoder. (Btw: For Firefox it's easy, just use the web developer toolbar.)

like image 311
Erik I Avatar asked Nov 13 '08 22:11

Erik I


People also ask

How do I scale windows in Ubuntu?

In Settings, go to Display settings. Here, select 200% as the scale factor and click on Apply button. It will change the display settings and ask you to confirm whether you want to keep the changed settings or revert to the original.

What is resize in Linux?

Description. Resize prints a shell command for setting the TERM and TERMCAP environment variables to indicate the current size of xterm window from which the command is run.


1 Answers

Use the wmctrl command:

To list the windows:

$ wmctrl -l 0x00c00003 -1 rgamble-desktop Bottom Expanded Edge Panel 0x00c00031 -1 rgamble-desktop Top Expanded Edge Panel 0x00e00022 -1 rgamble-desktop Desktop 0x0260007c  0 rgamble-desktop Google - Mozilla Firefox 

To resize a window based on its title:

wmctrl -r Firefox -e 0,0,0,640,480 

The arguments to the resize option are gravity,X,Y,width,height so this will place the window at the top-left corner of the screen and resize it to 640X480.

like image 109
Robert Gamble Avatar answered Sep 29 '22 18:09

Robert Gamble