179

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

I am using two screens:

  • My main screen is a LCD with max resolution 1920x1200.
  • My laptop screen (original resolution 3200x1800) 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 1920x1080.

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

  • 94x94 for my main LCD screen 1920x1200
  • 235x236 for my 3200x1800 laptop screen

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

Zanna
  • 70,465
Anthony O.
  • 2,539
  • 3
    Well, driving any LCD screen on a non-native resolution will appear blurry. That's because the way the pixels are laid out in a fixed way and the signal does not match this. What exactly are you expecting to happen? Disabling scaling perhaps? But then it's only displayed in the middle of the screen and not full screen. For optimal display always keep it your display on the native screen resolution. I don't think this has anything to do with Ubuntu. – gertvdijk Dec 23 '13 at 14:37
  • 3
    @gertvdijk: So do you have a way of keeping both monitors at their native screen resolution? I think that's what Anthony's asking. – beldaz Oct 07 '14 at 21:56
  • 3
    @beldaz My reply was to revision 1 of the question. It did not mention anything related to dual-screen setup at the time. Because the question was changed significantly, this raises the eyebrows for any posts changed after that date. It basically invalidates anything contributed and really lowers my motivation to help. Users should ask a new question instead, in my opinion. – gertvdijk Oct 07 '14 at 22:02
  • @gertvdijk Sorry, makes sense now. – beldaz Oct 07 '14 at 22:15
  • I wonder if the possibility to use Wayland in the newest Ubuntu makes this any easier to solve. – mkataja Jun 08 '15 at 14:18

12 Answers12

155

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
artem
  • 1,611
  • Tried something similar to this, I'm on a Dell XPS 15 (3200x1800) and a Monoprice IPS 27" (2560x1440) and it was not good times, haha. The difference between the two was still a bit much. Maybe I need to tweak the settings a bit. I dunno. Will keep trying. Thanks for tip! – karlgrz Dec 11 '14 at 21:27
  • 8
    got an error of failed request: BadValue (integer parameter out of range for operation) :-( – Juh_ Jan 19 '15 at 13:17
  • 1
    Thank this works almost perfectly. The only downside is a giant cursor on the low res monitor. Any idea how to fix that? – WayneC May 08 '15 at 10:11
  • No, unfortunately I have not found solution. By the way, keep track of the information on https://wiki.archlinux.org/index.php/HiDPI It seems to be updated often and have a good set of solutions – artem May 14 '15 at 08:34
  • 6
    The --fb option doesn't seem to enable more than a quarter of the 2x2 screen (mouse cursor can't be moved past top left quadrant) – EoghanM Sep 08 '15 at 17:33
  • 1
    Looks like there is still a separate bug which restricts area that mouse cursor can address: https://bugs.launchpad.net/ubuntu/+source/xorg-server/+bug/883319 – EoghanM Sep 14 '15 at 09:37
  • 4
    Scaling works, but don't you loose the HiDPI? Everything appears scaled and blurry. – Andy Sep 22 '15 at 08:15
  • +1 for the GDK_SCALE option, you should have this as a separate answer – EoghanM Oct 01 '15 at 13:40
  • 13
    For a side by side setup with a 1920x1080 external monitor sitting to the left of my 3200x1800 hiDPI laptop: xrandr --output eDP1 --scale 1x1 --pos 3840x0 ; xrandr --output HDMI1 --scale 2x2 --mode 1920x1080 --fb 7680x2160 --pos 0x0 – Daniel Bower Nov 13 '15 at 16:23
  • This works but settings are lost on restart, any ideas? – rizzle Jul 30 '16 at 03:03
  • I think the --scale option can have screen tearing issues. Moreover, if using the modesetting driver alone but not xf86-video-intel (assuming you have intel video card), the pointer on the primary display can flicker very badly, especially when OpenGl is selected. – Kun Jan 08 '17 at 02:54
  • 1
    I'm sorry but I don't get the --fb parameter. This need to be some calculation other than addition. – ringe Feb 23 '17 at 08:53
  • 4
    The --fb parameter is 2*external monitor + laptop screen – Brian C. Mar 16 '17 at 15:17
  • 4
    This almost works. But the problem now is that the font on the external monitor actually looks weird and blurry and I feel dizzy looking at it. Not sure if others encounter this problem as well. I guess this type of scaling is still imperfect then. For now I just take the middle ground and set the dpi value to 1.5x, and don't scale the external monitor at all. In this way the laptop's fonts are relatively small and the external monitor's fonts are relatively large, but they are still readable... – xji Feb 26 '18 at 14:17
  • Also, this seems to introduce problems if I have two external monitors, and want to place one to the side of the another? – xji Feb 27 '18 at 10:29
  • 1
    I found a temporary solution. That is to just downscale the HiDPI, built-in monitor instead with e.g. xrandr --output eDP1 --scale 0.5x0.5 --output DP2 --right-of eDP1 --output HDMI1 --right-of DP2. Plus, there is a different kind of bluriness on the downscaled HiDPI display, but I actually prefer this sort of bluriness to the one introduced on the upscaled external monitors. – xji Feb 28 '18 at 09:52
  • While I was using my XPS 15 with UHD screen with a 1080p external display, gnome's scaling factor of 0 (auto) was working fine. But when I changed the external display to a 1440p the display on 1440p was too big. I used a scale of 1.5 for the 1440p display and it's working great. – andho Mar 05 '18 at 17:03
  • This is mine for 2880x1620 and external 1920x1080 xrandr --output eDP1 --scale 1x1 --pos 2880x0 ; xrandr --output HDMI1 --scale 1.5x1.5 --mode 1920x1080 --fb 7560x2160 --pos 0x0 – Moga May 11 '18 at 05:29
  • For two HDMI (1920x1080) monitors and an HDPI XPS 13 9370 laptop (3840x2160) I have managed to get this working with the following commands: xrandr --output DP-1 --scale 2x2 --mode 1920x1080 --fb 3840x4320 --pos 0x0; xrandr --output DP-2 --scale 2x2 --mode 1920x1080 --fb 3840x4320 --pos 3840x0; xrandr --output eDP-1 --scale 1x1 --pos 320x2400; I do however have an issue with maximizing windows on the external monitors. The left hand one seems to maximize to 320x1080 and the right hand side one maximizes to 1600x1080... Has anyone managed to overcome this? – forgetso Nov 13 '18 at 18:35
  • @rizzle put it into a script and make it run on each start/login – xeruf Dec 06 '19 at 11:18
  • On my Dell XPS 15 9550 I found I had to switch from the (power-saving) intel graphics to nvidia (prime-select nvidia, then reboot) for my HDMI display to respect the --scale 2x2. Now firefox scrolling seems laggy but maybe that's a separate thing. – Jeremy Field Feb 25 '20 at 04:02
  • I made a script to automatize that scale calculation: https://askubuntu.com/a/1227147/973545 – Filip Sondej Apr 14 '20 at 20:32
  • I had an issue where the --pos value woul not take. The right hand desktop would start mid-way through the first monitor and it was panning when I moved the mouse. I did not have the issue where the mouse would get stuck, but the solution was (contrarily) still the same. Use --auto --panning WxH+X+Y, specifying virtual coordinates instead of the physical mode. – jozxyqk Mar 08 '21 at 22:14
  • what should my command be for a side-by-side screen with main monitor resolution 2560x1440 and external monitor 1920x1080? – Kong Aug 03 '21 at 06:30
25

On Ubuntu 20.04, for me clicking Fractional Scaling option in the bottom of display settings resolved everything. This will allow to scale each monitor separately.

9

I used artmem's solution but ran into the mouse problem mentioned by EoghanM. The workaround I found in the old bug report he linked to related to --panning.

I'm shooting for: - DP1-2 3840x2160 in native DIP. - eDP1 1366x768, scaled to look reasonable to the right of DP1-2.

I get this to happen by having a frame buffer that is like DP1-2 + (2x eDP1) then I scale everything going to eDP1 by 1/2.

This should be simple but xrandr is a bit tricky.

Here --scale is used to reduce everything going to eDP1 by 1/2. --panning is the same as eDP1 in the original frame buffer with the position (+3840+0) of just to the right of DP1-2. +0+2160 would be below it.

xrandr -d :0 --fb 6572x3696 --output DP1-2 --mode 3840x2160 --scale 1x1 --rate 60 --pos 0x0 --primary

# sometimes panning get applied incorrectly when switching from some other mode, running it twice is a work around
xrandr -d :0 --output eDP1 --off
xrandr -d :0 --fb 6572x3696 --output eDP1  --mode 1366x768  --scale 2x2 --panning 2732x1536+3840+0
xrandr -d :0 --fb 6572x3696 --output eDP1  --mode 1366x768  --scale 2x2 --panning 2732x1536+3840+0

I also set Xft.dpi to 185

$ cat ~/.Xresources
Xft.dpi: 185

When I unplug from the external monitor I run :

xrandr -d :0 --output DP1-2 --off
xrandr -d :0 --fb 2732x1536 --output eDP1  --mode 1366x768  --scale 2x2 --panning 2732x1536+0+0 --pos 0x0 --primary

That doesn't look great but I'm not away from my desk much. You could get around this by changing Xft.dpi and restarting all your desktop programs. I don't know of a way to change Xft.dpi and then get clients to use it without restarting them.

Brian C.
  • 216
  • 2
    Panning was the final piece of the puzzle - it solved the cursor stuck at a quarter of the screen issue. Thanks @Brian! – rtindru Apr 26 '17 at 11:50
  • 3
    "running it twice" ???? holy pixel, it works (I was already applying panning, but it's correctly applied only if I run the same command twice). – Riccardo Galli May 02 '17 at 17:44
  • Ya, I noticed that it was working about every other time I ran it so I thought I'd try it twice and, well, here we are. – Brian C. May 03 '17 at 19:10
  • Alright, so this doesn't work with the kernel 4.5.2. I installed just that kernel to deal with a docker related problem in 4.5.1 and now the above script leaves me with a black screen. To fix this on 4.5.2 I do the eDP1 commands first without the --off and then the DP1-2 command. – Brian C. May 10 '17 at 19:48
  • 1
    Finally worked with panning! I still have a glitchy mouse and screen though (since I've started using xrandr). Any idea? – hsandt Jul 25 '18 at 11:41
  • @hsandt I'd suggest running the command a couple more times. I really don't have much in the way of diagnostics or troubleshooting on this. For the mouse maybe check https://wiki.archlinux.org/index.php/Mouse_acceleration – Brian C. Jul 25 '18 at 18:56
  • 1
    Actually I meant the mouse was blinking, just like parts of some windows. But it got a little better during the afternoon, not sure why. – hsandt Jul 25 '18 at 19:23
  • 1
    I forgot, one last issue I have is that my app windows won't stretch beyond the left half part of my smaller res screen (as with an invisible wall), unless I move the window manually to the right and stretch it, without using the automated snapping stretch system (from Unity/compiz). – hsandt Jul 25 '18 at 19:33
8

These answers are all great, and helped me previously, but a recent

sudo apt-get upgrade 

deleted my randr-config! In attempting to restore my settings I found I could no longer get the mouse beyond the top 1/4th quadrant of the second screen, no matter the --fb input. From https://wiki.archlinux.org/index.php/HiDPI#Side_display I eventually discovered that adding panning did the trick. Also, use of '--right-of' or '--left-of' is simpler than '--pos'.

"Generically if your HiDPI monitor (laptop) is AxB pixels and your regular monitor (external) is CxD and you are scaling by [ExF], the commandline for right-of is:"

xrandr --output eDP-1 --auto --output HDMI-1 --auto --panning [C*E]x[D*F]+[A]+0 --scale [E]x[F] --right-of eDP-1
ONECore
  • 81
  • This is interesting, and it definitely seems like it could be useful to someone, although I'm not sure exactly that this belongs as an answer to this question. Maybe you should open and then answer your own question? Not really sure. – Hee Jin May 15 '18 at 16:14
  • 2
    @Emily: I think this answer belongs here. I used artem's answer today and had the exact problem ONECore stated (only the top-left quadrant of the screen was usable by the mouse). Luckily, I saw this answer, and panning worked instantly. – BrainCore May 16 '18 at 19:59
  • Yeah, sorry, I wanted it to be a reply to @artem's answer, but Stackexchange is super awesome and won't let me reply up there until I get 50 brownie points. – ONECore May 17 '18 at 17:58
  • Also note that this doesn't seem to be persistent, so unless you add it to xorg.conf, it goes away on each restart. But then if you add it there, it forces that setting no matter what (sometimes I don't plug in the monitor). So I find it super easy to just create a shell and execute it when I want. Simply add the code above to a text file ending in .sh (like resolution.sh), then make it executable with "chmod 0700 resolution.sh" in the terminal. – ONECore May 17 '18 at 18:03
  • Thanks so much for sharing your experience as well @BrainCore ! – Hee Jin May 21 '18 at 17:37
  • How crisp does the text looks like with this xrandr 'workaround'? – Melroy van den Berg Mar 14 '19 at 22:50
8

Why is it blurry?

Your screen always displays 3200x1800 pixels. If you lower the screen resolution on your computer that just means that your screen has to scale the image to fit your screen. Depending on the ratio between your native resolution and the current resolution, that scaling will produce a blurry image.

You can find more information on scaling and native resolution here: https://en.wikipedia.org/wiki/Native_resolution

How can I make the text bigger?

If the text is too small you have two options:

1. Change Ubuntu's font size

How do I change fonts and adjust their size?

2. Change DPI (will make the whole interface bigger, not only text)

How to find and change the screen DPI? (answer by @whtyger)

Merlijn Sebrechts
  • 7,394
  • 1
  • 42
  • 70
  • 1
    Just as a note on increasing font sizes. Rather increase the DPI so the whole user interface scales. This should be recognized properly automatically (reading the EDID from your display), but if that fails: How to find and change the screen DPI? – gertvdijk Dec 24 '13 at 18:40
  • I added the answer. Do I have to add the full answer or is it okay to just add the link? – Merlijn Sebrechts Dec 29 '13 at 10:34
  • In general it's best to give a short paraphrased summary directly in the answer, and use the link as a way to point to further information, rather than just post the link. This is especially the case when your answer doesn't otherwise answer the question. – thomasrutter Dec 29 '13 at 11:16
  • 26
    Actually that's not an answer for my question. I'm using two different screens with different resolutions. I've made the computation : my left main LCD screen should have 94x94 DPI resolution whereas my right laptop screen should have 235x235 DPI... And I don't find any way to set two different DPI resolution except by configuring nvidia to run 2 separated X, and then I can't pass one window from left to right... Windows is far better to handle that problem :( – Anthony O. Jan 06 '14 at 09:02
  • 11
    @AnthonyO. Please don't change your question considerably after an answer was posted you don't like. At the time this answer was posted you did not mention anything related to a dual-screen setup (see revision 1). Changing your question invalidates anything already posted and you should not do that. Instead, revert the question edits and post a new question instead. – gertvdijk Oct 07 '14 at 22:18
  • 6
    @MartinKonecny The original questioner substantially edited his question, this answer does answer his original question, check the revisions. – Jamie Kitson Mar 26 '15 at 22:09
  • @AnthonyO. FYI. Just switched back from Windows as High DPI with external screens connected is still broken. Creators Update had to address some of these issues, but they are still there. – Tom Raganowicz Sep 04 '17 at 06:02
5

I had a similar problem and solved it this way.

I have an external big screen 24" 3840x2160 and a laptop same definition 3840x2160 but small screen 15.4"

I wanted the laptop screen to be zoomed because default scaling is too small ..

Scaling down with xrandr as we usually see results in blurry screen, the solution is to scale everything up with xrandr then use gnome scaling factor :

Here is how to do it (external screen on top of laptop screen but you can arrange in a different way if you change pos parameters)

xrandr \
    --output DP-0 --primary --mode 3840x2160  --pos 0x0 --scale 2x2  --rotate normal \
    --output DP-2 --mode 3840x2160 --pos 0x4320 --scale 1x1  --rotate normal \
    --output DP-1 --off

Explanations :

--output : DP-1 is the external screen, DP-2 is the laptop screen (use xrandr -q to get your devices names)
--mode : both screen have same definitions 3840x2160
--scale 2x2 for external, 1x1 for laptop, this is "relative" to the primary which is external screen here..
--pos : external screen is at position 0x0, laptop screen is bellow at pos 0x(2160*2)=0x4320 because external screen is scalled by 2

Then

gsettings set org.gnome.desktop.interface scaling-factor 2

OR

gsettings set org.gnome.settings-daemon.plugins.xsettings overrides "{'Gdk/WindowScalingFactor': <2>}"

enter image description here

karel
  • 114,770
phico
  • 71
4

I spend hours to solve this issue. I have a 4k laptop and 1080p external monitor. If I set scaling to "200%" external monitors displays enlarged icons text etc.

I tried xrandr commands with "--scale" but they didnt give me the expected results. So I have a xrandr command that works perfectly for me. I wish somebody else find it helpful.

xrandr --output HDMI-1-1 --mode 1920x1080 --pos 0x0    --rate 60.00 \
       --transform 2,0,0,0,2,0,0,0,1 \
       --output eDP-1-1  --mode 3840x2160 --pos 0x2160 --rate 60.00 --primary

This commands works as external monitor scaled to "100%" and built-in screen scaled to "200%". This commands places external monitor above the built-in. Keep in mind you probably will change --output names with yours.

Note that 2160 in --pos 0x2160 has nothing to do with the height of eDP-1-1 (it just happens by chance to be the same value in my case). That number is in fact the height of the upper monitor (1080 in my case) corrected by the transformation (so 1080*2 in my case).

This is because --pos refers to the position of the upper left corner in the virtual screen space, so the bottom screen has to be positioned relative to the height of the upper screen.

Finally, you can ignore --rate flags. The most important flag here is --transform. And positions depends on screen resolutions and placements. Using this commands I have a Arandr preview like this;

Arandr screenshot

1080p monitor is virtually adjusted to take up twice as much space. Thanks to monitors are perfectly aligned, when I move the mouse from one screen to another, it appears on same horizontal coordinate

yalcinozer
  • 161
  • 5
  • Thanks, really. I was getting desperate. For some reason, I had to put the primary monitor at --pos 0x0 and position the other one accordingly. Otherwise, things weren't right (even after adjusting for the dimensions of my monitors). I read lots of posts and solutions, but they lead to blurry display or other issues. Yours does work. I started to question whether I needed another external monitor lol – prosoitos Dec 10 '20 at 05:27
  • The downside of my setting is that the mouse does not move between monitors in any intuitive way at all. But I just can't get it to work with the low res above the high res one. – prosoitos Dec 10 '20 at 05:42
  • OK. I finally figured it out. I will edit your post to make that part more clear. – prosoitos Dec 10 '20 at 21:10
4

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)

Jeets
  • 68
  • 1
    Is this a new answer or are you trying to report a bug? – user68186 Jul 20 '17 at 19:16
  • Its an elaboration on an existing answer, with more options that one can leverage. The answer provided by @artem above explains how these settings work. I simply attempted to provide 2 options that can be used as is for folks who have either a QHD or FHD external monitor, and a 4K primary monitor/laptop monitor.

    The bug is in the tearing you see with this solution. That is inherent to this approach.

    – Jeets Jul 21 '17 at 21:35
  • 3
    With proliferation of 4k and multi-resolution setups, I agree with the final paragraph this needs resolution. Was not too bad before, but now it is simply wrecking my setup on one monitor now that I have a 4k. Hopefully Ubuntu 18 LTS they will have this fixed. – neuronet Sep 11 '17 at 13:16
  • 4
    It's 2018... still the same sh1t :) – Stefanos Kalantzis Apr 27 '18 at 12:07
  • Wayland works great for this. Except that is just for this... Got a good experience with wayland+kde too, better than gnome+wayland. I am back to X due to lack of support for some software that only runs on X, and stability issues. 2018... – Victor Jun 09 '18 at 15:11
  • 1
    How crisp does the text looks like with this xrandr 'workaround'? – Melroy van den Berg Mar 14 '19 at 22:50
2

I have an outdated 1024x768 monitor, connected to a (less outdated) notebook.
The windows rendered in quite different sizes, much bigger in the external monitor (which has an older, bigger dot pitch).
I found a command to scale the monitor:

xrandr --output VGA-1 --scale 1.5x1.5

VGA-1 is the internal name of the monitor, found by running the following command:

xrandr --current | grep connected

The effect is that now the old monitor displays its contents at almost the same size as the notebook.

Curiously enough, it works scaling x1.5 but not 1.45, the display (in my case) turns black.

When I ran the scale comment the first time the result was frightening because the contents of both screens overlapped. For example the cursor pointer appeared twice.

I ran a program:

arandr &

to set the relative screen positions to fix it.
It works like the Settings > Devices > Displays setting.

I installed it with:

sudo apt-get install arandr

Thanks @LuisAlvarado and others for sharing your knowledge!

Zanna
  • 70,465
  • 1
    This works for me temporarily, but does not stick if I restart. I think I need to find a script to do what arandr is doing here, and then put the whole thing in my bashrc or something. Thanks! – Max von Hippel Oct 04 '19 at 16:34
  • arandr can export a config file. I set the file in my desktop and fed it into arandr at each reboot. Didn't develop a script and now I got a monitor and don't use arandr any more. – Juan Lanus Oct 06 '19 at 13:55
  • Just about anything xrandr / arandr does can also be specified in the xorg.conf file in the as options in the Monitor section; see xorg.conf(5) – Gavin S. Yancey May 13 '21 at 01:31
2

Fist run $xrandr to display all outputs

Screen 0: minimum 320 x 200, current 7680 x 2160, maximum 8192 x 8192
eDP-1 connected primary 3840x2160+0+0 (normal left inverted right x axis y axis) 344mm x 194mm
   3840x2160     60.00*+  59.98    59.97  
   3200x1800     59.96    59.94  
   2880x1620     59.96    59.97   
DP-1 disconnected (normal left inverted right x axis y axis)
DP-2 disconnected (normal left inverted right x axis y axis)
DP-3 connected 3840x2160+3840+0 (normal left inverted right x axis y axis) 521mm x 294mm
   1920x1080     60.00*+  50.00    59.94  
   1920x1080i    60.00    50.00    59.94  
   1680x1050     59.88  
   1280x1024     75.02    60.02

As you can see in this case the second monitor is connected to DP-3 Then you can resale the display: $xrandr --output DP-3 --auto --scale 2x2

Kevin Bowen
  • 19,615
  • 55
  • 79
  • 83
Abdelhak
  • 21
  • 1
1

I made a script to automatize the calculation in artem's anwser:

#!/usr/bin/env bash

# usage:
# ./script.sh 8 # to set scale 1.8

Y1=1440
X2=1680
Y2=1050

xrandr --output HDMI2 --scale 1.$1x1.$1 --fb $(($X2 * 1$1 / 10))x$(($Y1 + $Y2 * 1$1 / 10)) --pos 0x0
xrandr --output eDP1 --scale 1x1 --pos 0x$(($Y2 * 1$1 / 10))

It's ugly, because bash doesn't support operations on floats, but it works.

0

I tried all of the above and nothing seems to work flawless. In the end I just put two terminal entries into my Fluxbox menu. One for the high res display and one for the low res.

[exec] (Terminal 9pt) { xterm -fa Hack:size=9 } <>
[exec] (Terminal 12pt) { xterm -fa Hack:size=12 } <>
ceving
  • 311