How to force Steam UI doubling on linux

In 2018 Steam on linux got the ability to autodetect HiDPI screens and resize the UI accordingly. I would guess this kicks in on 4k resolutions. I’m guessing because I don’t have one. What I do have is a laptop with a 14″ 2560×1440 screen and failing eyesight. Alas, neither one triggers the UI resize. Here’s how to consistently force the UI resizing instead of relying on Steam’s autoconfiguration.

All that is required for the UI resizing (specifically, UI doubling) is for the environment variable GDK_SCALE to be set to the value 2. So running

GDK_SCALE=2 steam

from the command line should suffice. Personally, I prefer to use whatever applications menu my desktop environment provides. In order to get that working a) consistently and b) without being reset on system upgrades, I start by copying the Steam XDG desktop entry (the .desktop file) from the system level to my local level:

cp /usr/share/applications/steam.desktop ~/.local/share/applications/

I assume here that most desktop environments will be sufficient clever to detect that a local .desktop entry should override a global entry with the same name. GNOME at least seems to handle it intelligently.

The all we need to do is to add the environment variable to the local copy of the desktop entry. Apparently, the proper way to do that is to insert the string env GDK_SCALE=2 in the Exec= line of the desktop entry before the executable path, like so:

...
Comment[uk]=Програма для керування іграми та запуску ігор у Steam
Comment[vi]=Ứng dụng để quản lý và chơi trò chơi trên Steam
Exec=env GDK_SCALE=2 /usr/bin/steam %U
Icon=steam
Terminal=false
...

Save it and it should be working immediately, though a quick restart never goes amiss. Be sure to check that there are not two Steam icons in your applications menu (which is likely  happen if you change the desktop entry ‘Name’ variable).

Steam © Toniu (CC BY-NC-ND 2.0)

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.