Skip to content

Instantly share code, notes, and snippets.

@jamesob
Created January 2, 2022 02:33
Show Gist options
  • Save jamesob/7a71cff391b71582ef154f4db923ac4b to your computer and use it in GitHub Desktop.
Save jamesob/7a71cff391b71582ef154f4db923ac4b to your computer and use it in GitHub Desktop.
Install Spotify to run under Debian/Sway natively
  1. Install Spotify in the usual way:
curl -fsSL https://download.spotify.com/debian/pubkey_5E3C45D7B312C643.gpg | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/spotify.gpg
sudo apt update && sudo apt install spotify-client
  1. Compile stubs for X-specific calls that Spotify makes:
$ cat xstub.c

#include <stdio.h>

#define X_FN(f) int f() { puts("called"); return 0; }
X_FN(XInternAtoms)
X_FN(XChangeProperty)
X_FN(XGetGeometry)
X_FN(XInternAtom)
X_FN(XMoveResizeWindow)
X_FN(XSendEvent)
X_FN(XSetClassHint)
X_FN(XSetErrorHandler)
X_FN(XSetIOErrorHandler)
X_FN(XStoreName)
X_FN(XTranslateCoordinates)
$ cc xstub.c -o xstub.so -shared
$ sudo mv xstub.so /usr/local/lib/spotify-xstub.so && sudo chmod 644 /usr/local/lib/spotify-xstub.so
  1. Invoke Spotify in this way:
LD_PRELOAD=/usr/local/lib/spotify-xstub.so spotify --enable-features=UseOzonePlatform --ozone-platform=wayland
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment