K
K
klirichek2012-08-29 15:56:56
linux
klirichek, 2012-08-29 15:56:56

How to adjust physical monitor size in Ubuntu?

I'm working on a system with two monitors connected, and I'm suddenly puzzled by their different physical sizes.
The main one is a laptop with a diagonal of 14 "and a resolution of 1600x900. The second is a "large" monitor (17", 1280x1024).
The problem is that the system perceives the proportions of monitors only based on their resolution.

For example, a terminal window located "between" monitors looks like this:

image

Question: is it possible to "shaman" the system so that the physical dimensions are also taken into account?
How to do it?

Ubuntu 12.04 with default Unity

Answer the question

In order to leave comments, you need to log in

4 answer(s)
K
klirichek, 2012-08-30
@klirichek

In general, almost succeeded. Except for one moment, but more on that later.
I did not go into the global xorg settings.
The statement about the non-accounting of DPI also turned out to be not entirely true.
Step number one: see how it is now.

[email protected]:~$ xrandr
Screen 0: minimum 320 x 200, current 2880 x 1024, maximum 8192 x 8192
LVDS1 connected 1600x900+0+124 (normal left inverted right x axis y axis) 309mm x 174mm
   1600x900 60.0*+ 40.0  
   1440x900 59.9  
   1360x768 59.8 60.0  
   1152x864 60.0  
   1024x768 60.0  
   800x600 60.3 56.2  
   640x480 59.9  
VGA1 disconnected (normal left inverted right x axis y axis)
HDMI1 connected 1280x1024+1600+0 (normal left inverted right x axis y axis) 338mm x 270mm
   1280x1024 60.0*+ 75.0  
   1152x864 75.0  
   1024x768 75.1 70.1 60.0  
   832x624 74.6  
   800x600 72.2 75.0 60.3 56.2  
   640x480 72.8 75.0 66.7 60.0  
   720x400 70.1  
DP1 disconnected (normal left inverted right x axis y axis)
HDMI2 disconnected (normal left inverted right x axis y axis)
HDMI3 disconnected (normal left inverted right x axis y axis)
DP2 disconnected (normal left inverted right x axis y axis)
DP3 disconnected (normal left inverted right x axis y axis)

- you can immediately see both the resolution and the physical dimensions of the monitors.
What prevents the system from taking physical dimensions into account immediately? Unknown. But the fact is that they are, and they are true.
Step number two. We calculate the scaling factor (well, I'm used to using the pen as a calculator):
[email protected]:~$ python
Python 2.7.3 (default, Aug 1 2012, 05:14:39)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 900/174.0
5.172413793103448
>>> 1024/270.0
3.7925925925925927
>>> 5.1724/3.79259
1.3638173385470087
>>>

Step number three: apply the resulting coefficient and see what happens in the end:
[email protected]:~$ xrandr --output HDMI1 --scale 1.3638x1.3638
[email protected]:~$ xrandr
Screen 0: minimum 320 x 200, current 3346 x 1397, maximum 8192 x 8192
LVDS1 connected 1600x900+0+124 (normal left inverted right x axis y axis) 309mm x 174mm
   1600x900 60.0*+ 40.0  
   1440x900 59.9  
   1360x768 59.8 60.0  
   1152x864 60.0  
   1024x768 60.0  
   800x600 60.3 56.2  
   640x480 59.9  
VGA1 disconnected (normal left inverted right x axis y axis)
HDMI1 connected 1746x1397+1600+0 (normal left inverted right x axis y axis) 338mm x 270mm
   1280x1024 60.0*+ 75.0  
   1152x864 75.0  
   1024x768 75.1 70.1 60.0  
   832x624 74.6  
   800x600 72.2 75.0 60.3 56.2  
   640x480 72.8 75.0 66.7 60.0  
   720x400 70.1  
DP1 disconnected (normal left inverted right x axis y axis)
HDMI2 disconnected (normal left inverted right x axis y axis)
HDMI3 disconnected (normal left inverted right x axis y axis)
DP2 disconnected (normal left inverted right x axis y axis)
DP3 disconnected (normal left inverted right x axis y axis)

This already seems to be true!
There is one point left: the monitors are aligned to the bottom edge. In the initial version, this meant that the left one was offset by (1024-900)-124 pixels vertically. Now "large" has begun to imitate the vertical resolution already 1397; the offset must be set to 497 pixels:
[email protected]:~$ xrandr --output LVDS1 --pos 0x497

It turned out like this:
image
But one moment remained - these are the mouse coordinates. She still thinks that she is dealing with 1280x1024 - and therefore, on a scaled monitor, when moving down / to the right, she eventually rests against this invisible border. In the picture on a large monitor, the mouse is seen in its lowest-right possible position (i.e., it cannot be moved either lower or to the right there).
If anyone can tell me how to overcome this moment too, I will be very grateful!

B
Boris Syomov, 2012-08-29
@kotomyava

In practice, I did not try to adjust exactly two monitors (I had a need to set different dpi horizontally and vertically), but you can calculate the DPI of monitors horizontally and vertically, and specify them in xorg.conf in this way, naturally substituting the necessary values:
Section "Monitor" Identifier "My small monitor" Modes "1024x600" Option "DPI" "118 x 118" EndSection Section "Monitor" Identifier "My big monitor" Modes "1024x600" Option "DPI" "96 x 96" EndSection

V
volanddd, 2012-08-29
@volanddd

As far as I know, the current version does not take into account dpi, so this will be quite problematic

U
unwrecker, 2012-10-24
@unwrecker

According to the output of xrand in the second case, I see that the resolution is set higher than the standard one. And it appears to be scaling down. If so, then the described method is hellishly crutch, since it does not give point-to-point output and adds soapiness.
I wonder in general: is this a problem of unity or third party? In the second, dpi was easily adjusted.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question