7

If I use a second monitor on Ubuntu 20.04 and if it has the highes resolution (4K), the 1st screen keeps glitching. I found out after many tries that putting it to 175% of fractional scaling then 200% again will fix this issue, however it returns after the screen sleeps

enter image description here

So, I'd like a way to change to 175% and then 200% from command line so I can automate this into a script

Guerlando OCs
  • 863
  • 10
  • 51
  • 88

2 Answers2

4

You could probably handle this with xrandr, which is a more powerful tool than the Screen Resolution GUI. See, e.g., Monitor scaling does not work properly.

In your case, that would be

xrandr --output <out1> --scale 1.0x1.0 --output <out2> --scale 1.75x1.75
xrandr --output <out1> --scale 1.0x1.0 --output <out2> --scale 2.0x2.0

Note that you may need to tinker with other flags, e.g. --primary, --mode --pos, --fb.

  • 1
    Is this equivalent to the settings scaling? I tried xrandr --output <out1> --scale 2.0x2.0 --output <out2> --scale 1.75x1.75 then xrandr --output <out1> --scale 2.0x2.0 --output <out2> --scale 2.0x2.0 for 200% on first and 175% then 200% on second, but my screen got glitchy and I had to reboot – Guerlando OCs Jul 07 '21 at 02:03
  • @GuerlandoOCs - Yes, see update. You could check the refresh rate, before and after xrandr. – sancho.s ReinstateMonicaCellio Jul 07 '21 at 10:34
  • How do I use xrandr to get the current scaling factor? – Flimm Jul 13 '23 at 13:02
1

I found cool script generator for this: HIDPI-Fixer:

This application allows you to create a script that acomplishes the following tasks:

- Allow fractional scaling of your display and its components in X11
- The end result looks nicer and is way less buggy than using Wayland
- The generated script is configured to run everytime you log in
- You can also instruct the application to modify the ~/.profile file to correctly scale Qt-based apps (as KDE does)
- Tested on GNOME, Deepin Desktop and KDE (you need to manualy set the scaling factor to 200% in Deepin and KDE)

It worked for me.

zx485
  • 2,426
3draven
  • 11
  • 1