Ubuntu – Is it possible to have different DPI configurations for two different screens

displaydisplay-resolutiondpimultiple-monitorsscreen

I'm using Ubuntu 12.04.3 with NVidia drivers (319) for my Quadro K2100M graphic card, and when I switch my main 3200×1800 laptop screen to mode 1920×1080 (using nvidia-settings), the display goes blurry…

I am using two screens:

  • My main screen is a LCD with max resolution 1920×1200.
  • My laptop screen (original resolution 3200×1800) is sitting to the right of that.

The main problem is that, on Ubuntu, the font is far too small on my laptop screen. Because of that, I wanted to change the resolution of my laptop to 1920×1080.

Reading Galgalesh's answer, I tried to compute my DPI and here is the DPI configuration which I should have:

  • 94×94 for my main LCD screen 1920×1200
  • 235×236 for my 3200×1800 laptop screen

Is there a way to have dual DPI resolutions with an extended desktop?

Best Answer

It seems people are still struggling trying to work with several monitors and HiDPI displays. A good workaround is described in arch wiki https://wiki.archlinux.org/index.php/HiDPI#Multiple_displays. So, I have:

  • laptop asus ln303ux: 3200x1800,
  • external monitor: 1920x1200

Now I use Ubuntu 14.10 & GNOME Shell 3.12.2 that has pretty usable HiDPI support. So I just use out-of-the-box support of HiDPI - scaling factor is 2 (it can be set up via GUI). That means that on external monitor I get everything twice bigger than acceptable. Thus, I use xrandr; but instead of downscaling laptop screen, I upscale external monitor screen:

xrandr --output HDMI1 --scale 2x2 --mode 1920x1200 --fb 3840x4200 --pos 0x0
xrandr --output eDP1 --scale 1x1 --pos 320x2400

So, one by one:

  1. --output HDMI1 in my case is the external screen, eDP1 is the laptop screen.
  2. --scale 2x2 - make everything on external screen twice smaller
  3. --mode XxY - explicitly set the resolution for screen (not necessary if is already set)
  4. --fb XxY - set size of a virtual screen (framebuffer) (important without this, you will be able to use only a fourth part of the screen). In my case one screen was on top of another, so I added up effective heights 2400+1800=4200. Also note, that maximum framebuffer size might be specified in xorg.conf - then you cannot exceed it (it is written in the first line of xrandr -q output).
  5. --pos XxY - in my case I set absolute positioning of the screens, so my laptop screen is directly on the bottom of the external screen. The value Y here is double the external monitor height.

And this is it! Everything is as crisp as it could be.

FYI: to get the names of the screens and available resolutions, one can run xrandr --current. More information on setting the resolution an be found here: https://wiki.ubuntu.com/X/Config/Resolution .

UPDATE - OPTION 2: one more interesting workaround for applications that support GTK3. If I normally use only one application on the large screen (e.g. some IDE, like leksah), I do not resize the the screen, but run the application scaled to its original size

env GDK_SCALE=0.5 GDK_DPI_SCALE=0.5 CLUTTER_SCALE=0.5 appname
Related Question