More fun with xrandr

  • NB: double hyphens (with no space between!) are used for all options in xrandr

Sorting out my front screen display for my car pc has proven a bit of a nightmare, given its native resolution of 400 x 234/240. The vga converter I am using doesn’t offer 800×480.

So I looked to xrandr to help me out. The specific options for this are “- -mode”, “- -scale” and “– -pos

With “– -mode” I can set the resolution, in this case 800×600

With “– -pos” I can position the display offset, e.g. – -pos 10×10 would position the display 10pixels down and 10 pixels right. This is useful because the display doesn’t align centrally be default.

With “– -scale” I can resize the output of the display. So – -mode sets it at 800×600 and I can use a bit of arithmetic to output the display to 800×480 using a command such as – -scale 1.0×0.8

The end result being that the display from the PC is output via the vga converter to the car front screen at the right size, the right resolution and in the right position.

Of course, this only outputs a part of the original screen to the front screen, so you have to resize and reposition all your apps either from within the apps own settings or by using wmctrl / devilspie/gdevilspie. I am using mplayer, feh and yad and these are all manageable from within.

Couldn’t even begin to dream about how you might so simply achieve the same thing with Windows?

A full command line example might then be:

xrandr – -output VGA1 – -mode 800×600
– -pos 10×10 – -scale 1.0×0.8

Leave a Reply

Your email address will not be published. Required fields are marked *