Page 1 of 1

xrandr: a command set to fix your display(s)

Posted: 14 Mar 2014, 03:12
by francois
I am starting this thread to accumulate some knowledge on xrandr, a command very useful to fix one or two screens attached to a computer computer.

In this first post the information comes from a thread I first issued on the slax forum. The link is here:
http://old.slax.org/forum.php?action=vi ... ostid30879 :evil: link no more available.

General instructions.
Porteus usually provides the maximum screen size possible for the screens attached to your computer. Xrandr commands easily fix dual display problems. To help with your display or screen difficulties please provide make and model of your screen and the output in command line of:

Code: Select all

xrandr

1.0 Fixing a single screen resolution xrandr.
See the experience of @Petr.kx, who was caught with a resolution under the one that could be attained with his display:
http://www.slax.org/forum.php?action=vi ... ostid37773 :evil: link no more available.

Here Petr.kx wanted to add a resolution 1400x900 with a frequency of 60 that was not provided stock by the xorg.conf setting:

Code: Select all

root@slax:~# gtf 1400 900 60
 # 1400x900 @ 60.00 Hz (GTF) hsync: 55.92 kHz; pclk: 104.23 MHz
 Modeline "1400x900_60.00" 104.23 1400 1480 1632 1864 900 901 904 932 -HSync +Vsync
 root@slax:~# xrandr --newmode "1400x900_60.00" 104.23 1400 1480 1632 1864 900 901 904 932 -HSync +Vsync
 root@slax:~# xrandr --addmode VGA "1400x900_60.00"
2.0 Dual Monitors and xrandr. The Aptosid manual on xrandr (formerly Sidux):
http://manual.aptosid.com/en/hw-dev-mon-en.htm

3.0 Adjusting colors and brightness with xrandr: the gamma specification (this section is experimental, I am not sure that what I proposed is the real thing. However, the links are good and merit in depth reading and testing):
http://unix.stackexchange.com/questions ... -and-color
http://www.normankoren.com/makingfineprints1A.html
http://www.normankoren.com/makingfineprints1A.html

An ideal gamma configuration 1.05:1.15:1.136:
http://archive09.linux.com/articles/113936

Here is an example to correct your screen to what should be the right gamma values with the xrandr commands. This is about my dual display install, here the VAG1 display is corrected to the right gamma values:

Code: Select all

root@porteus:~# xrandr -q | grep connected
LVDS1 connected 1366x768+0+0 (normal left inverted right x axis y axis) 353mm x 198mm
VGA1 connected 1920x1080+1366+0 (normal left inverted right x axis y axis) 477mm x 268mm
HDMI1 disconnected (normal left inverted right x axis y axis)
DP1 disconnected (normal left inverted right x axis y axis)
DP2 disconnected (normal left inverted right x axis y axis)
root@porteus:~# xrandr --output VGA1 --gamma 1.05:1.15:1.136
4.0 Links on xrandr.
There is very few well documented hyperlinks on xrandr, here are my best ones, XStrikeForce/HowToRandR12 - Debian Wiki:
http://wiki.debian.org/XStrikeForce/HowToRandR12

The xrandr manual:
http://www.x.org/archive/X11R7.5/doc/ma ... ndr.1.html

And finally, an interesting thread on Grandr, a graphic interface for xrandr.
http://freshmeat.net/projects/grandr_applet/

I hope these links will be useful.

No problem if it is not the case, just come with your questions. :wink:

Note: Tell us more about your hardware when you have problems with your display. From:
http://old.slax.org/forum.php?action=vi ... ntID=52631
1) the manufacturer and model of your display could be quite useful.
2) the manufacturer and model of your linux box and of the graphic card. The graphic card spec:

Code: Select all

lspci |grep VGA
lspci |grep Ethernet 
or if not positive

Code: Select all

lspci

Re: xrandr: a command set to fix your display(s)

Posted: 13 Sep 2014, 21:33
by francois
For reading purposes, a dimmer screen brightness is easier on the eye. This could be also a way to save on your laptop batteries.

Unable to adjust the second display (the stand alone) of my laptop installation thru kde settings, I found this interesting solution using xrandr that I have adapted:
http://askubuntu.com/questions/149054/h ... via-script
1.0 Get the xrandr tag for your the standalone display, here mine was VGA1:

Code: Select all

root@porteus:~# xrandr
Screen 0: minimum 320 x 200, current 2806 x 900, maximum 32767 x 32767
LVDS1 connected 1366x768+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
   1366x768       60.2*+
...
VGA1 connected primary 1440x900+1366+0 (normal left inverted right x axis y axis) 410mm x 256mm
   1440x900       59.9*+
...
On a scale from 0.0 to 1.0 adjust the brightness of your given screen or of both screens.

Code: Select all

root@porteus:~# xrandr --output VGA1 --brightness 0.5 
Or

Code: Select all

oot@porteus:~# xrandr --output VGA1 --brightness 0.5 --output LVDS1 --brightness 0.5

Re: xrandr: a command set to fix your display(s)

Posted: 04 Jul 2015, 18:59
by francois
xrandr error message fix for 'failed to get size of gamma for output default' :
https://bugs.launchpad.net/ubuntu/+sour ... ug/1078695
http://forum.porteus.org/viewtopic.php? ... 4&start=15

Re: xrandr: a command set to fix your display(s)

Posted: 25 Jul 2015, 03:58
by francois
Added the pertinency of the hardware components and command to fetch the graphic card.

Re: xrandr: a command set to fix your display(s)

Posted: 28 Jul 2015, 02:27
by francois
Adjusting to the right gamma values. An example is given in the first post.8)

But as an afterthought, gamma adjustment must be more complicated than I thought at first. :(

xrandr: a command set to fix your display(s)

Posted: 25 Oct 2017, 01:38
by francois
Modified the information on the first post. This information on xrandr is really still useful. :)

Re: xrandr: a command set to fix your display(s)

Posted: 08 Dec 2018, 10:42
by francois
The resolution on my laptop is so fine that the characters are difficult to read.
ASUS Gaming Thin and Light Laptop, 15.6-inch Full HD , Intel Core i7-7700HQ Processor, 16GB DDR4 RAM, 128GB SSD + 1TB HDD, GeForce GTX 1060 3GB.


This is why I wanted to resort to a smaller screen size. This is what I tried below.

Code: Select all

root@porteus:~# xrandr
Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 16384 x 16384
eDP-1 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 344mm x 193mm
   1920x1080     60.05*+
   1680x1050     60.00  
   1400x1050     60.00  
   1280x1024     59.95  
   1280x960      59.99  
   1152x864      59.97  
   1024x768      59.95  
   800x600       59.96  
   640x480       59.94  
   720x400       59.97  
   640x400       59.96  
   640x350       59.84  
HDMI-1 disconnected (normal left inverted right x axis y axis)
DP-1 disconnected (normal left inverted right x axis y axis)
root@porteus:~# xrandr --output eDP-1 --mode 1024x768


Unable to set the screen to an inferior value to 1920x1080, porteus will fall in command line mode.

Any suggestion will be appreciated.
Thanks.

Re: xrandr: a command set to fix your display(s)

Posted: 08 Dec 2018, 11:52
by ncmprhnsbl
francois wrote:
08 Dec 2018, 10:42
The resolution on my laptop is so fine that the characters are difficult to read.
isn't that what the font size settings are for? :)

xrandr: a command set to fix your display(s)

Posted: 08 Dec 2018, 13:58
by francois
Hi there ncmprhnsbl. Hail to you.
CHEAT CODE
There is a cheatcode for that? :)

FONT APPROACH :no:
Thru
panel > settings >appearance
you get it for the porteus system

But then it has to be done for the browser, and then ? ... within the xfce4-terminal it does not work. :no: ...

XRANDR
I pretty like xrandr and used to get it done this way. One script and you are done. B)
I wonder why it does not work though?

Re: xrandr: a command set to fix your display(s)

Posted: 18 Dec 2018, 00:51
by francois
There is something peculiar about eDP-1. I will have to search that. It seems to take care of the second screen by itself.

Here a thread which need some analysis:
https://blog.summercat.com/configuring- ... randr.html

Hum! B)

Re: xrandr: a command set to fix your display(s)

Posted: 20 Dec 2018, 04:16
by Rava
francois wrote:
13 Sep 2014, 21:33
For reading purposes, a dimmer screen brightness is easier on the eye. This could be also a way to save on your laptop batteries.
For just this reason I set all my browsers to black desktop with light green text, super nice on the eyes.

Anyhow, could xrandr save more battery on a laptop even when the DE (like XFCE) is able to dim the screen by itself?

Re: xrandr: a command set to fix your display(s)

Posted: 22 Dec 2018, 01:20
by francois
Brightness is more easily adjusted according to an author with xcalib utility:
https://booss.org/reducing-screen-brigh ... ith-xcalib

From what I can understand you could effectively do better with a simple xcalib command than with xrandr. To reduce brightness to 70%

Code: Select all

xcalib -a -co 70
Ideal for a dark room according to above thread.

I have used it under Porteus in the past. Quite easy. You will have to test.