I am using an LG 5K monitor, and the display scaling options are very limited in gnome-shell, only increments of 100%.
To have fractional scaling, I tried this script:
#!/bin/bash
gsettings set org.gnome.desktop.interface scaling-factor 2
gsettings set org.gnome.settings-daemon.plugins.xsettings overrides "{'Gdk/WindowScalingFactor': <2>}"
xrandr --output DP-1 --scale $1x$1
I added that in a script inside /usr/bin/scale_me_please.sh and make it executable:
sudo chmod +x /usr/bin/scale_me_please.sh
Now, whenever I am at work and need to scale it, I just run:
scale_me_please.sh 1.4
Just perfect!
Update: This change has introduced some screen tearing for me on Intel graphics. The solution was to add the following:
Section "Device"
Identifier "Intel Graphics"
Driver "intel"
Option "TearFree" "true"
EndSection
To /etc/X11/xorg.conf.d/20-intel.conf
For some reason, this changed my display from DP-1 to DP1, so I modified my script replacing the former with the latter.
Enjoy!
Sources:
https://wiki.archlinux.org/index.php/Intel_graphics#Tearing
https://askubuntu.com/questions/1029436/enable-fractional-scaling-for-ubuntu-18-04