18

I have multiple screens with different correct DPI settings. I can use xrandr --dpi X to change DPI for all screens, is it possible to set different DPI for each screen? How do I make apps recalculate font sizes when they are moved to a different screen? xrandr --dpi X only affects new windows, old windows still use the old DPI value.

3

I haven't tried it out yet, but there is a good looking answer here which suggests using the xrandr option scale which should get you the effect you're after.

UPDATE: This does work, I've written summary instructions here.

  • 3
    Please, always copy-paste instructions to the answers. It's precaution against information loss of historical questions. Sooner or later, most of external links area DEAD, and that would make your answer pointless... Anyway, most of the users would like to see answers on one site, ... – kravemir Oct 4 '16 at 16:32
  • Even if that site is another StackExchange site? – Jamie Kitson Oct 10 '16 at 15:03
  • The scale command seem to be very GPU intensive when comparing to multi-monitor set-up on Windows 10. Scale means scaling the pixels directly while Windows 10 resizes the text. – Kun Jan 1 '17 at 17:27
3

I was able to solve this (with issues) using the details outlined in the following github discussion: https://github.com/linuxmint/Cinnamon/issues/3606

External Monitor QHD (2560X1440), Internal/Laptop Monitor 3200x1800

xrandr --output eDP-1 --scale 1x1 --pos 0x2880
xrandr --output DP-1 --mode 2560x1440 --scale 2x2 --fb 5120x4680

OR External Monitor FHD (1920x1080), Internal/Laptop Monitor 3200x1800

xrandr --output eDP-1 --scale 1x1 --pos 0x2160
xrandr --output DP-1 --mode 1920x1080 --scale 2x2 --fb 3840x3960

These work, but there is a significant amount to tearing in the high resolution monitor (laptop) when I move windows, resize screens or scroll on a browser. This feels like a software rending solution (which has all these issues of tearing, and slow refreshes).

Its 2017, Linux/Gnome needs to address the multi-monitor, mixed scaling solution. Both Windows 10 and OS X have this resolved without having to resort to command line band-aid fixes that partially work (the tearing issue isn't acceptable for gaming)

2

you can set different values for each screen with:

xrandr --output <Display1> --dpi X --output <Display2> --dpi Y

To se what are available use just xrandr,to restart the font. I think you could turn off the display and turn it on again with with:

xrandr --output <Display1> --off
xrandr --output <Display1> --auto

but am not really sure

  • 2
    As far as I can see '--dpi' is not a per-output setting. It results in a call to XRRSetScreenSize for the entire screen. As far as I can see X11 simply does not support setting different DPI values for different outputs. Which would suck... – Arnout Engelen Mar 6 '14 at 21:54
  • 2
    Ah, actually RandR outputs do have a width/height specified in both pixels and millimeters, so different outputs can have a different DPI - but AFAICS there is no RandR call to manipulate the physical size of the output. – Arnout Engelen Mar 6 '14 at 22:12
  • 6
    Various sources including wiki.archlinux.org/index.php/HiDPI#External_displays suggest that only a single DPI setting is possible at once (in a single Xserver instance). The xrandr command suggested by Agomezl doesn't work. – Vladimír Čunát Jan 23 '15 at 9:57
1

It is not possible to set different DPI with xrandr.

To handle this situation, there are a number of solutions in various forums and Stack Exchange using scaling (e.g. --scale 2x2 or --scale-from 1920x1440).

While these did work for me, there was a slight blurriness on the up-scaled monitor. It was not very obvious and could be missed easily, but I am very sensitive to such things and it gave me headaches.

A better solution which does not create any blurriness is to use --transform instead of --scale. I have no idea what transform does differently from scaling and the fact that it works is only an empirical observation.

The position of the 2 monitors needs to be set properly: the likes of --left-of, --below, etc. don't work as they don't take into account the transformation.

Here is what I am using, with explanations for each value so that you can adapt it to your situation:

xrandr --output DP-1 --mode 2560x1440 --pos 0x0 --transform 2,0,0,0,2,0,0,0,1 --output eDP-1 --mode 3840x2400 --pos 0x2880 --primary

You can find the name and the proper default resolution for your monitors by running xrandr without arguments.

  • My external monitor (DP-1) has a resolution of 2560x1440
  • I need to transform the resolution by a factor of 2
  • My laptop (eDP-1) has a resolution of 3840x2400

I want to have my external monitor above the laptop. --pos is the position of the top left corner of one monitor in the monitor space (the total area occupied by both monitors).

--pos 0x0 puts the external monitor at the top.

To have the laptop below it, I need to get the proper value for the y coordinate (x will of course be 0 in this case): it is the height of the external monitor (1440) corrected by the transformation (a factor of 2 here), i.e. 1440*2 = 2880.

I am thus using --pos 0x2880 for the laptop.


For reference, this is the system I am using:

  • OS: Arch Linux
  • WM: i3
  • Laptop: 4k
  • External monitor: 1080p

Note: I initially posted a very similar answer on another Stack Exchange here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.