Display parameters:
- Notebook built-in display (eDP-1) Resolution: 3840x2160
- External monitor (HDMI1) resolution: 1920x1200
The above parameters can be obtained through xrandr
commands.
question
In the extended mode, the internal and external monitors cannot set the scale independently. As a result, when the scale of the built-in monitor is set to 200%, the text on the external monitor appears very large.
Solution
Use xrandr settings.
- First set the scale to 200% in the system display ;
- Then execute the following command:
xrandr --auto --output eDP-1 --pos 0x0 --mode 3840x2160 --primary --scale 0.9999x0.9999 --output HDMI-1 --mode 1920x1200 --right-of eDP-1 --pos 3840x0 --scale 2x2
restore settings
When an external monitor is unplugged, an incorrect aspect ratio may appear. At this point you can restore the default setting (100% scale):
xrandr --auto
Or restore the built-in display to 200% scale:
xrandr --auto --output eDP-1 --pos 0x0 --mode 3840x2160 --primary --scale 1x1
Permanent setting method
The above method settings will be invalid after restarting. To achieve a permanent setting, the following methods can be used:
- Modify
/etc/profile
the file and add instructions that need to be permanently set - save restart
If you often need to plug in or switch between extended screens with different resolutions, it is recommended not to set it permanently. My solution is to ~/.bashrc
set the alias and execute it when needed, such as:
## for dual monitor better display, reference from [ubuntu 18.04下,扩展显示屏设置不同scale](https://blog.csdn.net/lyh458/article/details/118676907)
alias dm="xrandr --auto --output eDP-1 --pos 0x0 --mode 3840x2160 --primary --scale 0.9999x0.9999 --output HDMI-1 --mode 1920x1200 --right-of eDP-1 --pos 3840x0 --scale 2x2"
## reset the default display setting
alias sm="xrandr --auto --output eDP-1 --pos 0x0 --mode 3840x2160 --primary --scale 1x1"
Referenced from: