HiDPI Scaling with Spotify and Flatpak on Fedora Linux

I found some trouble getting my spotify client to scale correctly to my HiDPI screen after installing it. Hopefully this tutorial will help someone having the same problem.

  1. Install spotify via flatpak using the instructions on flathub.
  2. You can force spotify to scale to your display using the --force-device-scale-factor=X command line option. I find X=1.6 works the best for me, but this will change depending on your setup. So, full command to do this in your terminal emulator is flatpak run com.spotify.Client --force-device-scale-factor=1.6.
  3. In order to make this change permanent, you can modify the desktop file to send this command line option whenever Spotify is launched via the icon. cd /var/lib/flatpak/exports/share/applications/ and edit the com.spotify.Client.desktop file as root with your favorite text editor. Change the Exec variable to include the above command line option. Note that these changes will be overridden if Spotify updates. You can instead copy the desktop file to ~/.local/share/applications/ and make your changes there. It should look similar to this:
Spotify desktop screenshot
  1. Restart your computer and Spotify should correctly scale the next time you launch it! Update: sudo update-desktop-database and then launch Spotify from your application launcher.

Thanks to Daniel Aleksandersen for catching a few mistakes with this tutorial!