xrandr: Linux Resize / Set The Screen Size Quickly Via Command Line Options

by Vivek Gite · 8 comments

Generally, I need to switch my Gnome screen size to 800x600 to watch TV via TV-Tunner card as my card supports max 800x600 resolution. For rest of my work I prefer to use 1024x768 pixels. You can create a shortcuts on the desktop to resize screen quickly:

Right click on desktop > Select Create Launcher

Setup Launcher properties as follows

Setup Name to 1024x763

Setup Generic name to Resize

Setup Command to xrandr -s 0

Click on Close to save changes.

The xrandr command is used to set the screen size, orientation and/or reflection.It can also set the screen size. The xrandr -s 0 command will setup screen size to 1024x763 pixels. You can get list of supported screen size along with number using xrandr command:
$ xrandr -q
Sample outputs:

SZ:    Pixels          Physical       Refresh
*0   1024 x 768    ( 283mm x 212mm )  *61
 1    800 x 600    ( 283mm x 212mm )   73
 2    640 x 480    ( 283mm x 212mm )   73
Current rotation - normal
Current reflection - none
Rotations possible - normal
Reflections possible – none

The SZ number can be passed to xrandr -s <SZ> to setup desire screen size in pixels. Create one more Launcher for 800x600 screen size. And you are done just click on ICONS to setup desired screen size. This will save lots of time :D Here is my desktop image along with these and others shortcuts:

xrandr - primitive command line interface to RandR extension

Featured Articles:

Want to read Linux tips and tricks, but don't have time to check our blog everyday? Subscribe to our daily email newsletter to make sure you don't miss a single tip/tricks. Subscribe to our weekly newsletter here!

{ 8 comments… read them below or add one }

1 Anonymous 08.28.05 at 3:21 pm

Never knew xrandr command ever exists

2 Anonymous 09.14.05 at 2:38 am

On Fedora(and Redhat) you can also use [ctl]+[alt] + number pad +/- to cycle though the screen res.

3 cyberciti 09.14.05 at 12:11 pm

That’s not correct.

xrandr changes the physical/real resolution.

Xrandr can switch the video mode along with the dimensions of the root window. ctrl+alt +/- uses the VidMode extension to switch the video mode, but it can’t change the dimension of the root window.

4 eddie 10.26.07 at 8:07 am

Is it possible to use this feature with an indvidual window within your whole resolution?

For example:

I have 1280×1024 screen resolution and I want to resize Firefox to 1024×768 within my resolution.

5 Jon 12.24.08 at 9:52 am

Very CoooooooL
Thank You :) !!

6 B J Russ 03.04.09 at 7:51 pm

I haven’t yet seen a comment like my difficulty. I have used xrandr with my Ubuntu machine. It rotates the display 90 deg. (to fit my rotatable flat screen) but it doesn’t fill the portrait mode position so I’m still left with a landscape ‘view’ and a blank portion at the bottom of the screen. Any ideas ?

7 Kat 02.16.10 at 2:48 am

This is wonderful. I’m now using this command (and launchers) to rotate the screen on my Asus EeePC to read ebooks, doc files and PDFs with greater ease, not to mention long web pages. The netbook’s shallow 600 px screen was making me wear out the page down button! OpenOffice files were a bit too wide, but I set the View>zoom to “optimal” and that took care of it. The built-in trackpad seems to be confused by the switch, but a USB/wireless mouse handles cursor movement perfectly. Thanks for the tips.

8 rajesh 02.20.10 at 1:20 pm

but can it change resolution of external hardware attached to it such as Set Top box ………..

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Previous post:

Next post: