Automatic fix for Spotify scaling bad on HiDPI screens on Arch Linux using yaourt, hooks and pacman

Spotify scales pretty bad on HiDPI screens (like the XPS 13 with 4k screen). All the text is small and barely readable. Tangram mentioned a fix for this issue, but everytime you update Spotify from the AUR it will update and break the .desktop file.

To make pacman fix this automatically there is a feature called Hooks. In the following we will create a hook to replace the .desktop file, which is the starter for spotify on a lot of window managers.

First we need a small script that will rewrite this file:

Do not forget to set your scaling factor in line 8 to a reasonable value. 2.3 works fine for the XPS13 with a 4k display.

You need to save this file to

Then we will create a hook, that will run on “Upgrade” and “Install”.

Save this hook to

If this directory does not exist, create it using

That’s it. Just upgrade spotify using yaourt and pacman will run the hook.

Leave a Reply

Your email address will not be published. Required fields are marked *

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