How to Change Screen DPI Scaling in Xubuntu
If you are running Xubuntu with a modern HiDPI display, you may want to adjust the DPI scaling level to make everything look bigger on the screen. You may already notice that the only option that the Xfce desktop environment offers is scaling for fonts. This is usually not enough, as the other controls remain downscaled and tiny.
Today, many PCs ship with very high resolution displays even if the PC form factor is smaller for example, an Ultrabook or a tablet. Or you may have a desktop monitor with 4K resolution. At such resolutions, the OS is supposed to automatically turn on DPI scaling so everything on your screen becomes larger.
DPI stands for Dots per inch. It is the physical measurement of number of pixels in a linear inch of a display. DPI defines a scale factor that must be transfered to apps to resize their content and controls. Today, most popular scaling factors are in range 95-110 DPI.
You may want to adjust the DPI value if the OS fails to detect it properly, or you find the current value not suitable for your needs.
As mentioned above, the font scaling option that can be found in Settings > Appearance on the Fonts tab only partially solves the issue. Controls without text labels remain tiny.
So, I decided to go with a different method.
For the Xorg server, which is used by default in Xubuntu, the
-dpi command line argument has the highest priority. By adding this option to its startup command, you'll force it to use the desired DPI scaling level. Xubuntu is using the
lightdm display manager, so the option can be set in the lightdm configuration.
To Change Screen DPI Scaling in Xubuntu,
- Open a new terminal, e.g click App menu > Accessories > Terminal Emulator.
- Type the following command:
sudo mousepad usr/share/lightdm/lightdm.conf.d/50-xserver-command.conf. Substitute
mousepadwith your favorite console or GUI text editor. Mousepad is what Xubuntu offers by default for the DE.
- Type your user password when prompted.
- Modify the value of the
xserver-commandoption by adding
-dpi <your DPI value here>to the end of the line. In the screenshot I have set it to 125, that plays well with my display.
- The above will work for GTK apps. To scale Qt apps, you need to open the hidden
.profilefile in your home directory, and add
export QT_SCALE_FACTOR=<scaling value>to the end of that file.
- You can quickly edit that file with the command
mousepad ~/.profile. For the 125 DPI scaling level, I've set QT_SCALE_FACTOR to 1.2.
You are done. Now, you can sign out from your X user session and sign in back (or restart Xubuntu) to apply the changes you made. Everything should be scaled properly.