Austin Adams

Fixing Spotify on HiDPI on Ubuntu

December 2, 2020

The official “Spotify for Linux” page states:

Spotify for Linux is a labor of love from our engineers that wanted to listen to Spotify on their Linux development machines. They work on it in their spare time and it is currently not a platform that we actively support.

These brave engineers should be commended …for their incredible eyesight:

Screenshot of tiny Spotify

For those of us with HiDPI displays, here’s how to make the Spotify UI readable on Ubuntu. I installed the spotify snap package, so these notes assume you have too.

  1. Create the user desktop entries directory:

    mkdir -p ~/.local/share/applications
    cd ~/.local/share/applications
    
  2. Copy the snap Spotify .desktop entry to your user desktop entries directory (source for this approach):

    cp -nrv /var/lib/snapd/desktop/applications/spotify_spotify.desktop .
    
  3. I changed the following two lines of spotify_spotify.desktop:

    Icon=/snap/spotify/43/usr/share/spotify/icons/spotify-linux-128.png
    Exec=env BAMF_DESKTOP_FILE_HINT=/var/lib/snapd/desktop/applications/spotify_spotify.desktop /snap/bin/spotify %U
    

    to the following:

    Icon=/snap/spotify/current/usr/share/spotify/icons/spotify-linux-128.png
    Exec=env BAMF_DESKTOP_FILE_HINT=/home/austin/.local/share/applications/spotify_spotify.desktop /snap/bin/spotify --force-device-scale-factor=2 %U
    

    Note the --force-device-scale-factor=2 flag at the end there. It could be something other than 2 for you, depending on your display configuration.

  4. Now if you close Spotify and log out and log back in, you should hopefully be able to actually see things when you reopen Spotify. (If you use GNOME and don’t want to log out, you can do Alt-F2 and run r to reload GNOME Shell.)