4K 2x Scale in Ubuntu 18.04

This is a perfect workaround for ubuntu 18.04 user who own the 4k resolution display.

following these steps:

Open up a terminal window. Then run the following two commands to install Unity 7 desktop from the default software repository.

sudo apt update
sudo apt install ubuntu-unity-desktop

During the installation, you will be asked to choose a display manager. You can choose lightdm display manager, which will give you the Unity Login screen. gdm is the default display manager for GNOME desktop.

Once the installation is complete, restart your Ubuntu 18.04 computer.

sudo shutdown -r now

Now you are greeted by Unity login screen. What a warm feeling to have it back! If you don’t want to keep GNOME on the list of available desktop environments, uninstall it with the following command.

sudo apt remove gnome-shell

After removing the gnome-shell, reboot your system again, and performing the following steps:

go to Setting->Screen Display->Scale for menu and title bars, set as 2.

and type the following line:

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

to overwrite the gtk window scale.

For login screen scaling factor change, do the following:

sudo nano /usr/share/glib-2.0/schemas/org.gnome.desktop.interface.gschema.xml

Modify the following content:

<key name="scaling-factor" type="u">
<default>2</default>

save and run the following script:

sudo glib-compile-schemas /usr/share/glib-2.0/schemas

Done.

JetBrains IDE scales

Increase the default font size (Settings > Appearance & Behavior > Appearance > Override default font) so that UI scaling factor is calculated from it and add -Dide.ui.scale=2.0 in Help Edit Custom VM Options.
Written on February 13, 2019