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.
- 602
4 Answers
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)
- 31
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 of2560x1440 - I need to transform the resolution by a factor of 2
- My laptop (
eDP-1) has a resolution of3840x2400
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.
- 133
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.
- 743
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