Launching Spotify With a Custom DPI on Linux

I’m using Manjaro at the moment and after getting 4K monitors I learned that Spotify ignores UI scaling settings. You
can run Spotify with --force-device-scale-factor=x.x but I wanted my desktop shortcut to work properly too, so here’s
how I did that.

Summary

Create a file called spotify-custom.desktop, put it where your .desktop files go and put this in it:

1
2
3
4
5
6
7
8
9
10
11
[Desktop Entry]
Type=Application
Name=Spotify
GenericName=Music Player
Icon=spotify-client
TryExec=spotify
Exec=spotify --uri=%U --force-device-scale-factor=1.63
Terminal=false
MimeType=x-scheme-handler/spotify;
Categories=Audio;Music;Player;AudioVideo;
StartupWMClass=spotify

Drag that file to your task manager and use that to launch Spotify.

Explanation

In Manjaro application launchers are defined as .desktop files in /usr/share/applications. More info and other
possible folder locations here: https://wiki.archlinux.org/title/desktop_entries

My spotify.desktop contains the following:

1
2
3
4
5
6
7
8
9
10
11
[Desktop Entry]
Type=Application
Name=Spotify
GenericName=Music Player
Icon=spotify-client
TryExec=spotify
Exec=spotify --uri=%U
Terminal=false
MimeType=x-scheme-handler/spotify;
Categories=Audio;Music;Player;AudioVideo;
StartupWMClass=spotify

I updated the Exec key to the following:

1
Exec=spotify --uri=%U --force-device-scale-factor=1.63

and this solved my problem until Spotify updated and overwrote my changes, so I duplicated spotify.desktop to
spotify-custom.desktop, made my Exec change in there, and dragged my new desktop file to my Task Manager. Now I use
that to launch Spotify and everything is nice and legible.