Icons Look too Small? Enable Fractional Scaling to Enjoy Your HiDPI 4K Screen in Ubuntu Linux
Last updated August 24, 2021 By Abhishek Prakash 6 Comments
A few months ago, I bought a Dell XPS laptop with a 4K UHD screen. The screen resolution is 3840×2400 resolution with a 16:10 aspect ratio.
When I was installing Ubuntu on it, everything looked so small. The desktop icons, applications, menus, items in the top panel, everything.
It’s because the screen has too many pixels but the desktop icons and rest of the elements remain the same in size (as on a regular screen of 1920×1080). Hence, they look too small on the HiDPI screen.
This is not pretty and makes it very difficult to use your Linux system. Thankfully, there is a solution for GNOME desktop users.
If you too have a 2K or 4K screen where the desktop icons and other elements look too small, here’s what you need to do.
Scale-up display if the screen looks too small
If you have a 4K screen, you can scale the display to 200%. This means that you are making every element twice its size.
Press the Windows key and search for Settings:
In Settings, go to Display settings.
Here, select 200% as the scale factor and click on Apply button.
It will change the display settings and ask you to confirm whether you want to keep the changed settings or revert to the original. If things look good to you, select “Keep Changes.”
Your display settings will be changed and remain the same even after reboots until you change it again.
Enable fractional scaling (suitable for 2K screens)
200% scaling is good for 4K screens however if you have a 2K screen, the 200% scaling will make the icons look too big for the screen.
Now you are in the soup. You have the screen looking too small or too big. What about a mid-point?
Thankfully, GNOME has a fractional scaling feature that allows you to set the scaling to 125%, 150%, and 175%.
Using fractional scaling on Ubuntu 20.04 and newer versions
Ubuntu 20.04 and the new versions have newer versions of GNOME desktop environment and it allows you to enable or disable fractional scaling from Display settings itself.
Just go to the Display settings and look for the Fractional Scaling switch. Toggle it to enable or disable it.
When you enable the fractional scaling, you’ll see new scaling factors between 100% to 200%. You can choose the one which is suitable for your screen.
Using fractional scaling on Ubuntu 18.04
You’ll have to make some additional efforts to make it work on the older Ubuntu 18.04 LTS version.
Second, enable fractional scaling as an experimental feature using this command:
Third, restart your system and then go to the Display settings and you should see the fractional scaling toggle button now.
Disabling fractional scaling on Ubuntu 18.04
If you are experiencing issues with fractional scaling, like increased power consumption and mouse lagging, you may want to disable it. Wayland could also be troublesome for some applications.
First, toggle the fractional scaling switch in the display settings. Now use the following command to disable the experimental feature.
Switch back to Xorg from Wayland again.
Multi-monitor setup and fractional scaling
4K screen is good but I prefer a multi-monitor setup for work. The problem here is that I have two Full HD (1080p) monitors. Pairing them with my 4K laptop screen requires little settings change.
What I do here is to keep the 4K screen at 200% scaling at 3840×2400 resolution. At the same time, I keep the full-HD monitors at 100% scaling with 1920×1080 resolution.
To ensure a smooth experience, you should take care of the following:
Did it help?
HiDPI support in Linux is far from perfect but it is certainly improving. Newer desktop environment versions of GNOME and KDE keep on improving on this front.
Fractional scaling with Wayland works quite well. It is improving with Xorg as well but it struggles especially on a multi-monitor set up.
I hope this quick tip helped you to enable fractional scaling in Ubuntu and enjoy your Linux desktop on a UHD screen.
Please leave your questions and suggestions in the comment section.
Like what you read? Please share it with others.
HiDPI в Linux
Aqua Mine
Введение
После многолетнего доминирования дисплеев с высокой плотностью пикселей на мобильных устройствах, данная тенденция наконец-то дошла и до лаптопов с десктопами. По моему мнению, производители не ставили HiDPI-матрицы в основном из-за слабой поддержки DPI, отличных от 96, в Windows. К счастью, ситуация заметно улучшилась с выходом Windows 8 с Modern UI, хотя в десктопном режиме все еще далеко не идеальная — люди до сих пор жалуются на 3200×1800 при 13.3″ в лаптопах и сомневаются о покупке 4K UHD 23.8″-монитора.
DPI и Linux
Возможность установки произвольного значения DPI появилась еще во времена Xfree86, но следует понимать, что это просто значение, которое ничего не делает само по себе. Его считывают и используют программы и компоненты, которые и принимают решение, каким образом отразить изменение DPI на экране. Если текст следует установленному значению DPI в 95% случаев (спасибо xft!), то размер элементов зависит от используемого окружения рабочего стола и тулкитов, на которых написаны приложения.
Я попытался выяснить, какие DE можно комфортно использовать с HiDPI-мониторами. Тестирование проводилось на лаптопе с 12.5″ 1366×768 (125 DPI) с подключенным внешним 23.8″-монитором с разрешением 3840×2160 (185 DPI).
Gnome 3
Поддержка высокой плотности пикселей в Gnome 3 реализована путем двойного скейлинга всех элементов и шрифтов, т.е. технически DPI устанавливается в значение 192. Явно задать другой DPI можно следующей командой:
Cinnamon
Так как Cinnamon написан с использованием GTK+ 3, поддержка HiDPI у него реализована примерно так же, как у Gnome 3: двойное увеличение элементов, шрифтов. Все выглядит так же хорошо, так и в случае Gnome 3. Как вы можете заметить, единственное приложение на скриншоте, которое выглядит мелко — VLC, он написан на Qt4. Поддержка скейлинга на каждый монитор также отсутствует.
KDE 5
Большинство KDE-приложений, написанных на QtQuick, умеют работать с любым DPI. Как таковая кнопка для включения HiDPI-режима отсутствует, но при установки значения DPI в 185 не только шрифты, но и элементы автоматически увеличиваются. По какой-то причине, из Plasma 2 убрали возможность ресайза многих вылезающих меню, например, главного меню запуска приложений Kicker, или диалога выбора сети апплета NetworkManager. Это вносит неудобства и несколько портит впечатление от DE, но, к счастью, есть обходные пути. Некоторые приложения, например, файловый менеджер Dolphin, все еще полноценно не портированы на Qt5, поэтому выглядят хуже, чем могли бы при использовании Qt5.
Возможность использования разных DPI на разных мониторах отсутствует. Что ж, ждем Qt 5.6.
На скриншоте вы можете видеть прекрасный баг видеоподсистемы DRI3, которая задействована в Fedora 22 по умолчанию — скриншотер KSnapshot снял свой собственный диалог сохранения.
Mate поддерживает установку произвольного значения DPI. Скейлинга как такового нет, но многие приложения поддерживают работу с произвольным DPI, хоть и местами едут. Иконки не масштабируются. Хороший выбор для владельцев мониторов с граничным значением DPI, когда целочисленный скейлинг не подходит. Скейлинга на каждый монитор отдельно нет.
Unity
Unity — единственная среда рабочего стола, которая поддерживает скейлинг на каждый монитор отдельно. К сожалению, скейлятся только элементы самой DE (левая и верхняя панель, главное меню), но не приложения, что практически не дает какой-то реальной пользы. Вместо указания DPI, Unity предлагает выбрать коэффициент масштабирования, исходя из базового значения DPI в 96. Я установил ползунок в значение 1.75, задав таким образом DPI 168.
В целом, ситуация напоминает Gnome 3, что неудивительно, ведь Unity тоже написан на GTK+ 3.
Есть ли жизнь с двумя мониторами?
Хоть ни один из тулкитов и DE не поддерживает работу с мониторами с разной плотностью пикселей, и все выглядит либо слишком крупно, либо слишком мелко, существует возможность скейлинга каждого монитора отдельно средствами X11. Это позволяет без особых проблем вывести не слишком требовательную к качеству отображения картинку, например, при кратковременном подключении ноутбука к проектору.
Для осуществления такого скейлинга, нам нужно установить виртуальное повышенное разрешение на дисплее с меньшим DPI и уменьшить его до оригинального разрешения средствами X11:
где 2×2 — коэффициент скейлинга по горизонтали и вертикали, а 6572 = 1366*2 + 3840 — сумма горизонтального разрешения обоих мониторов с учетом скейлинга.
Заключение
Если у вас используется только один монитор, с двойной (192 DPI) или тройной (288 DPI) плотностью пикселей, то можете использовать практически любой современный DE и приложения без особых проблем. Если же у вас какое-то граничное значение DPI, для которого не подходит целочисленный скейлинг (150, 240), либо же если вы часто используете два монитора, только один из которых с высокой плотностью пикселей, то придется страдать и использовать скейлинг средствами X11, смотря на размытые шрифты. Остается надеется, что с приходом Qt 5.6 ситуация изменится в лучшую сторону, а там и GTK+ 3 подтянется.
HiDPI
HiDPI (High Dots Per Inch) displays, also known by Apple’s «Retina Display» marketing name, are screens with a high resolution in a relatively small format. They are mostly found in high-end laptops and monitors.
Not all software behaves well in high-resolution mode yet. Here are listed most common tweaks which make work on a HiDPI screen more pleasant.
Contents
Desktop environments
GNOME
To enable HiDPI, navigate to Settings > Devices > Displays > Scale and choose an appropriate value. Or, use gsettings:
Fractional scaling
Wayland
Enable the experimental fractional scaling feature:
then open Settings > Devices > Displays (the new options may only appear after a restart).
To enable the option for all users, create the following three files with the corresponding content
Then run dconf update and restart the machine. This will permanently lock the option.
You can achieve any non-integer scale factor by using a combination of GNOME’s scaling-factor and xrandr. This combination keeps the TTF fonts properly scaled so that they do not become blurry if using xrandr alone. You specify zoom-in factor with gsettings and zoom-out factor with xrandr.

GNOME ignores X settings due to its xsettings Plugin in Gnome Settings Daemon, where DPI setting is hard coded. There is blog entry for recompiling Gnome Settings Daemon. In the source documentation there is another way mentioned to set X settings DPI:
You can use the gsettings, just make sure to read previous setting first and merge it. In just simply set it with this command:
Noting that variants must be specified in the usual way (wrapped in <>).
Note also that DPI in the above example is expressed in 1024ths of an inch.
Text Scaling
Alternatively, or in addition to changing the display scaling, you can separately scale text. This can be done by navigating to Fonts > Scaling Factor in Gnome Tweaks, or using gsettings. Note that the text scaling factor need not be limited to whole integers, for example:
GTK+ vs Gnome Shell elements on Xorg
Once these changes have been saved, activate them by switching to another theme (for example, using gnome-tweaks ) and then reverting back again. The top bar, application menus, calendar, and other shell elements should now be correctly scaled.
In addition to editing the relevant shell theme’s CSS file, users on Xorg may also wish to increase the title bar font at the top of open applications. This can be done through the dconf editor ( org > gnome > desktop > wm > preferences :: titlebar-font ). Note that the title-bar-uses-system-fonts option should also be turned off. Alternatively, use gsettings:
KDE Plasma
You can use Plasma’s settings to fine tune font, icon, and widget scaling. This solution affects both Qt and GTK applications.
To adjust font, widget, and icon scaling together:
To adjust only font scaling:
To adjust only icon scaling:
Tray icons with fixed size
Xfce supports HiDPI scaling which can be enabled using the settings manager:
Alternatively, it is possible to do the same from command line using xfconf-query :
After either of the above changes, fonts in some GTK applications may still not be scaled; you may additionally do the following (see #GDK 3 (GTK 3)):
/.profile ) to un-scale some fonts that would be scaled twice
The steps above would set 2x scaled resolution for Xfce and other GTK 3 apps.
Scaling for Qt 5 apps should be set manually, see #Qt 5. Note that if you set a Custom DPI for fonts above, you likely need to set QT_FONT_DPI=96 to avoid double-scaling of fonts in Qt applications.
Cinnamon
Has good support out of the box.
Enlightenment
For E18, go to the E Setting panel. In Look > Scaling, you can control the UI scaling ratios. A ratio of 1.2 seems to work well for the native resolution of the MBPr 15″ screen.
X Resources
If you are not using a desktop environment such as KDE, Xfce, or other that manipulates the X settings for you, you can set the desired DPI setting manually via the Xft.dpi variable in Xresources:
Make sure the settings are loaded properly when X starts, for instance in your
/.Xresources (see Xresources for more information).
This will make the font render properly in most toolkits and applications, it will however not affect things such as icon size! Setting Xft.dpi at the same time as toolkit scale (e.g. GDK_SCALE ) may cause interface elements to be much larger than intended in some programs like firefox.
X Server

Some programs may still interpret the DPI given by the X server (most interpret X Resources, though, directly or indirectly). Older versions of i3 (before 2017) and Chromium (before 2017) used to do this.
To verify that the X Server has properly detected the physical dimensions of your monitor, use the xdpyinfo utility from the xorg-xdpyinfo package:
This example uses inaccurate dimensions (423mm x 328mm, even though the Dell XPS 9530 has 346mm x 194mm) to have a clean multiple of 96 dpi, in this case 192 dpi. This tends to work better than using the correct DPI — Pango renders fonts crisper in i3 for example.
If the DPI displayed by xdpyinfo is not correct, see Xorg#Display size and DPI for how to fix it.
GUI toolkits
Since Qt 5.6, Qt 5 applications can be instructed to honor screen DPI by setting the QT_AUTO_SCREEN_SCALE_FACTOR environment variable:
If automatic detection of DPI does not produce the desired effect, scaling can be set manually per-screen ( QT_SCREEN_SCALE_FACTORS ) or globally ( QT_SCALE_FACTOR ). For more details see the Qt blog post or Qt developer documentation.
GDK 3 (GTK 3)
Setting the GDK scale will scale the UI, however it will not scale icons. If you are using a minimal window manager where you are setting the dpi via Xft.dpi, GDK should scale perfectly fine with it. In other cases, do the following:
To scale UI elements by an integer factor:
To undo scaling of text, fractional scale can be used:
GTK 2
Electron
Elementary (EFL)
To scale UI elements by a factor of 1.5:
GNUstep
GNUstep applications that use its gui (AppKit) library accept a GSScaleFactor property in their defaults (STEP preferences). To define a scaling factor of 1.5 for all apps:
Some automatic detection was possible back in 2011, but the code responsible for the X11 backend was commented out thereafter.
Boot managers
Lower the framebuffer resolution
Set a lower resolution for the framebuffer as explained in GRUB/Tips and tricks#Setting the framebuffer resolution.
Change GRUB font size
Convert the font to a format that GRUB can utilize:
Edit /etc/default/grub to set the new font as shown in GRUB/Tips and tricks#Background image and bitmap fonts:
systemd-boot
Adding the following line and running bootctl update increases font-size in the systemd-boot menu:
Applications
If you are running a Wayland session, but application is running via Xwayland (either because it does not support Wayland natively or because it uses X11 by default), you could still get blurry fonts and interface, even if the application supports HiDPI. See this bug report. See also Wayland#Detect Xwayland applications visually.
Browsers
Firefox
Firefox should use the #GDK 3 (GTK 3) settings. However, the suggested GDK_SCALE suggestion does not consistently scale the entirety of Firefox, and does not work for fractional values (e.g., a factor of 158DPI/96DPI = 1.65 for a 1080p 14″ laptop). You may want to use GDK_DPI_SCALE instead. Another option, which will avoid Firefox-specific settings in many setups is to use the settings in #X Resources as Firefox should respect the Xft.dpi value defined there.
To override those, open Firefox advanced preferences page ( about:config ) and set parameter layout.css.devPixelsPerPx to 2 (or find the one that suits you better; 2 is a good choice for Retina screens), but it also does not consistently scale the entirety of Firefox.
If you use a HiDPI monitor such as Retina display together with another monitor, you can use AutoHiDPI add-on in order to automatically adjust layout.css.devPixelsPerPx setting for the active screen. Also, since Firefox version 49, it auto-scales based on your screen resolution, making it easier to deal with 2 or more screens. For users of Firefox version 57 and above, the ffreszoom add-on will adjust the page zoom if it detects you are using a large monitor (zoom level and threshold are configurable). Modifying the internal CSS DPI setting from an extension is currently unsupported [1].
Chromium / Google Chrome
Chromium should use the #GDK 3 (GTK 3) settings.
Using this option, a scaling factor of 1 would be normal scaling. Floating point values can be used. To make the change permanent, for Chromium, you can add it to
To make this work for Chrome, add the same option to
If you use a HiDPI monitor such as Retina display together with another monitor, you can use the reszoom extension in order to automatically adjust the zoom level for the active screen.
If using Wayland session, you should enable native wayland support to avoid blurriness. See also Chromium#Incorrect HiDPI rendering.
Opera
Opera should use the #GDK 3 (GTK 3) settings.
Gimp 2.10
To fix toolbar icon sizes, update Preferences->Interface->Icon Theme->Custom icon size to huge or other value.
If menu fonts are still too small you can update an existing theme by copying it from /usr/share/gimp/2.0/themes into
You can also try using gimp-hidpi (installation instructions are outdated and refer to version 2.8, in Gimp 2.10 the theme should be installed into
Inkscape
To scale the icons to a «usable» size go to Preferences > Interface and set the icon size to Large or Larger[2][3].
Java applications
AWT/Swing
Since Java 9 the GDK_SCALE environment variable is used to scale Swing applications accordingly.
JavaFX
Mixed AWT/Swing and JavaFX
IntelliJ IDEA
IntelliJ IDEA supports two HiDPI modes (JRE-managed and IDE-managed). The sequence for determining system scale factor is well documented at [4]:
For troubleshooting, consult the «Show HiDPI Info» dialog via search everywhere «Shift Shift».
If this does not work, the experimental GTK option scale-monitor-framebuffer might be enabled on Wayland (see above). Currently JetBrains products run on xwayland and thus have no native wayland support yet. This makes the rendering in JetBrains products incompatible with the monitor scaling framebuffer. Disabling the framebuffer thus might solve blurry font/rendering issues for JB products, but alas results in disabled fractional scaling.
LibreOffice
LibreOffice on all VCL backends take setting from there respective toolkits. There is a bug where the kf5 backend on Wayland does not scale [5]. Use the gtk3 VCL backend instead.
MATLAB
Recent versions (R2017b) of MATLAB allow to set the scale factor[6]:
The settings take effect after MATLAB is restarted.
This can become tedious if you need to change the scaling frequently. To simplify this, consider using the following script:
To change the display scaling to 3:
Mono applications
According to [7], Mono applications should be scalable like GTK 3 applications. The precise method depends on the GUI library: GtkSharp obviouslys points back to Gtk, while the usual Windows Forms (libgdiplus) simply detects Xft settings.
NetBeans
The editor fontsize can be controlled from Tools > Option > Fonts & Colors.
The output window fontsize can be controlled from Tools > Options > Miscelaneous > Output
OBS Studio
Start obs with the environment variable QT_AUTO_SCREEN_SCALE_FACTOR=0 to disable Qt’s hi-dpi migration mode. It is partially buggy (preview window can disappear after first start, depending on window position) and prevents OBS Studio from capturing at native resolution.
The downside of this option is that the UI elements will now be messed up. To mitigate this, install the Yami theme, which works well on hi-dpi displays:

Then, open File → Settings → General → Theme and chose Yami.
Skype
Spotify
You can change scale factor by simple Ctrl++ for zoom in, Ctrl+- for zoom out and Ctrl+0 for default scale. Scaling setting will be saved in
Also Spotify can be launched with a custom scaling factor which will be multiplied with setting specified in
Steam
Official HiDPI support
Unofficial
The HiDPI-Steam-Skin can be installed to increase the font size of the interface. While not perfect, it does improve usability.
MetroSkin Unofficial Patch also helps with HiDPI on Steam with Linux.
Sublime Text 3
Sublime Text 3 has full support for display scaling. Go to Preferences > Settings > User Settings and add «ui_scale»: 2.0 to your settings.
Thunderbird
VirtualBox
VirtualBox also applies the system-wide scaling to the virtual monitor, which reduces the maximum resolution inside VMs by your scaling factor (see [9]).
This can be worked around by calculating the inverse of your scaling factor and manually setting this new scaling factor for the VirtualBox execution, e.g.
Wine applications
and change the «dpi» setting found in the «Graphics» tab. This only affects the font size.
Zathura document viewer
No modifications required for document viewing.
UI text scaling is specified via configuration file (note that «font» is a girara option):
Set the scaleFactor variable in
For the Flatpak version, set the environment variable QT_SCALE_FACTOR (e.g. to 0.5 [10]). This can be easily done with Flatseal, if using a GUI tool is preferred.
Gazebo
Gazebo only renders an upper left of a view instead of the whole view. To fix this a Qt enviorment variable must be set. To run Gazebo:
To run a ROS simulation:
Making an alias such as gazebo=»QT_SCREEN_SCALE_FACTORS=[1.0] gazebo» works for the first case but not for the second.
Fcitx
Fcitx preedit FontSize can be changed in
Unsupported applications
run_scaled-git AUR can be used to scale applications (which uses xpra internally).
Multiple displays
The HiDPI setting applies to the whole desktop, so non-HiDPI external displays show everything too large. However, note that setting different scaling factors for different monitors is already supported in Wayland.
Side display
One workaround is to use xrandr’s scale option. To have a non-HiDPI monitor (on DP1) right of an internal HiDPI display (eDP1), one could run:
When extending above the internal display, you may see part of the internal display on the external monitor. In that case, specify the position manually.
You may adjust the «sharpness» parameter on your monitor settings to adjust the blur level introduced with scaling.
Multiple external monitors
There might be some problems in scaling more than one external monitors which have lower dpi than the built-in HiDPI display. In that case, you may want to try downscaling the HiDPI display instead, with e.g.
In addition, when you downscale the HiDPI display, the font on the HiDPI display will be slightly blurry, but it’s a different kind of bluriness compared with the one introduced by upscaling the external displays. You may compare and see which kind of bluriness is less problematic for you.
Mirroring
If all you want is to mirror («unify») displays, this is easy as well:
With AxB your native HiDPI resolution (for ex 3200×1800) and CxD your external screen resolution (e.g. 1920×1200)
In this example which is QHD (3200/1920 = 1.66 and 1800/1200 = 1.5)
For UHD to 1080p (3840/1920=2 2160/1080=2)
You may adjust the «sharpness» parameter on your monitor settings to adjust the blur level introduced with scaling.
Tools
There are several tools which automate the commands described above.
Linux console
The Linux console changes the font to TER16x32 (based on ter-i32b from terminus-font [13]) accordingly based on the resolution of the display. If your monitor is not recognised as HiDPI, the default font can be changed. In that case, specify fbcon=font:TER16x32 in the kernel command line.
Fonts outside the kernel
After changing the font, it is often garbled and unreadable when changing to other virtual consoles ( tty2-6 ). To fix this you can force specific mode for KMS, such as video=2560×1600@60 (substitute in the native resolution of your HiDPI display), and reboot.
Users booting though UEFI may experience the console and boot loader being constrained to a low resolution despite correct KMS settings being set. This can be caused by legacy/BIOS boot being enabled in UEFI settings. Disabling legacy boot to bypass the compatibility layer should allow the system to boot at the correct resolution.








