Change Screen DPI Scaling in Xubuntu

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.

Advertisment

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.

Xubuntu Appearance Fonts

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,

  1. Open a new terminal, e.g click App menu > Accessories > Terminal Emulator.
  2. Type the following command: sudo mousepad usr/share/lightdm/lightdm.conf.d/50-xserver-command.conf . Substitute mousepad with your favorite console or GUI text editor. Mousepad is what Xubuntu offers by default for the DE.
  3. Type your user password when prompted.Xubuntu Type Password For Sudo
  4. Modify the value of the xserver-command option 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.Xubuntu Change DPI
  5. The above will work for GTK apps. To scale Qt apps, you need to open the hidden .profile file in your home directory, and add export QT_SCALE_FACTOR=<scaling value> to the end of that file.
  6. 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.Xubuntu Change DPI For Qt

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.

Advertisment

Leave a Reply

Your email address will not be published. Required fields are marked *