1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
|
---
title: Use xrandr to set a screen resolution
date: 2014-08-27T19:26:04Z
source: http://blog.bodhizazen.net/linux/use-xrandr-to-set-a-screen-resolution/
tags: linux
---
From time to time I see posts on various Linux forums asking how to set a screen resolution.
Often this results in a discussion about writing a configuration file, xorg.conf ( /etc/X11/xorg.conf )
While there is nothing wrong with writing a xorg.conf, xorg.conf is depreciated and writing an xorg.conf is intimidating to many users.
Using xrandr is potentially faster and easier.
## How to use xrandr
First display a list of your monitor resolutions
xrandr -q
**Note**: If you do not see the resolution you desire listed, either your monitor does not support that particular resolution or you may need to install a driver (ati, intel, or nvidia are the big 3). The technical details of installing these drivers varies by graphics card and will not be covered in this blog.
Then set the resolution you want to use (change the "1400×1050″ to your desired resolution).
xrandr -s 1400x1050
## Adjusting the dpi (dots per inch)
dpi refers to the resolution of your monitor (pixels per inch) and affects window decorations, window size, and font. See [this page][1] for additional information.
On many monitors xrandr will set the dpi automatically. When it does not, or if you prefer an alternate setting, you can try specifying a dpi manually.
xrandr --dpi 96 -s 1400x1050
If that fails, you can specify a dpi in ~/.Xdefaults
Open any editor and enter the following configuration:
Xft.dpi: 96
This dpi will then be applied to any new windows you open. Alternately you can log off and back on (no need to reboot).
If 96 is not the right size for your, try a smaller ( 72 ) or larger ( 135 ) value.
## Dual monitors
To use xrandr to configure dual monitors, use the --right-of or --left-of options.
Example, using a nvidia card:
First list your monitors with xrandr, note the monitor names (in bold).
bodhi@zenix:~$ xrandr -q
Screen 0: minimum 320 x 200, current 1920 x 1200, maximum 4096 x 4096
**DVI-I-1** connected 1920x1200+0+0 (normal left inverted right x axis y axis) 520mm x 320mm
1920×1200 60.0*+
1600×1200 60.0
1680×1050 60.0
1280×1024 75.0
1280×960 60.0
1152×864 75.0
1024×768 75.1 70.1 60.0
832×624 74.6
800×600 72.2 75.0 60.3 56.2
640×480 72.8 75.0 60.0
720×400 70.1
**DVI-I-2** connected 1920x1200+0+0 (normal left inverted right x axis y axis) 520mm x 320mm
1920×1200 60.0*+
1600×1200 60.0
1680×1050 60.0
1280×1024 75.0
1280×960 60.0
1152×864 75.0
1024×768 75.1 70.1 60.0
832×624 74.6
800×600 72.2 75.0 60.3 56.2
640×480 72.8 75.0 60.0
720×400 70.1
TV-1 disconnected (normal left inverted right x axis y axis)
Use xrandr to configure the monitors. Change the names "DVI-I-1″ and "DVI-I-2″ to the names of your monitors. You may also need to adjust the resolution and change "--left-of to" "--right-of"
xrandr --auto --output DVI-I-2 --mode 1920x1200 --left-of DVI-I-1
Has the same effect as
xrandr --auto --output DVI-I-1 --mode 1920x1200 --right-of DVI-I-2
## Set a primary display
To set a primary display, use the --primary option.
xrandr --auto --output DVI-I-1 --mode 1920x1200 --primary --right-of DVI-I-2
## Configuring xrandr to run when you log in
The method to do this varies by desktop and with most major desktop environments (gnome, kde, xfce) you would add the xrandr command to your start up options / applications.
With openbox, add the xrandr command to ~/.config/openbox/autostart.sh.
With fluxbox, use ~/.fluxbox/startup
Alternately, depending on your window manager, you can add the xrandr command to ~/.xinit
For a link on using ~/.xinit, see this [fluxbox wiki page][2] or, as an alternate, the [Arch wiki Slim page][3].
## Graphical tools
I am aware of <s>3</s> 5 (thanks to charlie-tca and KenP) graphical font ends for xranadr : [lxrandr][4] , grandr, the [grandr applet][5], [ARandR][6], and Krandr.
lxrandr is a part of the lxde and is lightweight and fast, but does not have all of the xrandr options available.
grandr has more a few more options, including rotation, but again not all the xrandr options are available from the graphical interface.
grandr applet is a small application (gnome applet) that would run in your panel and similar to lxrandr allows one to set a resolution.
Krandr is a KDE applet to set your resolution.
arandr is similar to grandr, but IMO the interface seems less intuitive. Arandr will write a script for you to set your resolution at login.
For additional information on using xrandr, see the [xrandr man page][7].
[1]: http://www.proaxis.com/~ferris/docs/dpi-monitor.html
[2]: http://fluxbox-wiki.org/index.php?title=.xinitrc
[3]: https://wiki.archlinux.org/index.php/SLiM
[4]: http://wiki.lxde.org/en/LXRandR
[5]: http://sites.google.com/site/kdekorte2/grandr_applet
[6]: http://christian.amsuess.com/tools/arandr/
[7]: http://manpages.ubuntu.com/manpages/natty/en/man1/xrandr.1.html
|