Desktop

How to Set correct Screen DPI in Linux Xresources

Let’s discuss how you can find and change screen DPI in Linux distribution. This is the most common setting for users using i3 dynamic tiling window manager. For systems with higher resolution, the default DPI setting is often lower than the required setting. This means you may get blurry or small icons and fonts.

Original content from computingforgeeks.com - post 15516

First, check your system resolution.

$ xdpyinfo | grep -B 2 resolution
screen #0:
dimensions: 1920x1080 pixels (508x285 millimeters)
resolution: 96x96 dots per inch

If you don’t have xdpyinfo command, it may need to be installed.

# Install xdpyinfo on Debian / Ubuntu
$ sudo apt -y install x11-utils

# Install xdpyinfo on Debian / Ubuntu
$ sudo pacman -S xorg-xdpyinfo

# Install xdpyinfo on CentOS / RHEL / Fedora
$ sudo yum -y install xorg-x11-utils

Once you have screen resolution of your system, visit http://dpi.lv/. or goodcalculators ppi calculator

generate dpi from resolution

Input your screen resolution and diagonal values. The pixels per inch will be auto-generated for your Computer with provided resolution values.

generate dpi from resolution goodcalculators

We can now set correct dots per inch (DPI) on ~/.Xresources file. The Xresources is a user-level configuration dotfile used to set X resources, which are configuration parameters for X client applications.

This is my DPI setting on the file.

Xft.dpi:   141

Load a resource file using:

$ xrdb ~/.Xresources

You can also load a resource file, and merge with the current settings:

$ xrdb -merge ~/.Xresources

To see the currently loaded resources:

$ xrdb -query -all

Your system display should now be fine for all Applications. You should not have to manually tweak scaling factor for high resolution displays.

Also check:

Configure i3pystatus on Linux

How to configure mpd and ncmpcpp on Linux

Keep reading

Things to Do After Installing CachyOS Arch Linux Things to Do After Installing CachyOS How to Install CachyOS: Step-by-Step Guide Arch Linux How to Install CachyOS: Step-by-Step Guide Install Arch Linux the Easy Way with archinstall Arch Linux Install Arch Linux the Easy Way with archinstall 10 Best Desktop Linux Distributions to Try in 2026-2027 Desktop 10 Best Desktop Linux Distributions to Try in 2026-2027 Install Ultramarine Linux 44 Step by Step (With Screenshots) Desktop Install Ultramarine Linux 44 Step by Step (With Screenshots) Install Spotify on Ubuntu 24.04 / Linux Mint 22 / Debian 13 Debian Install Spotify on Ubuntu 24.04 / Linux Mint 22 / Debian 13

Leave a Comment

Press ESC to close