Skip to content

Instantly share code, notes, and snippets.

@mdierolf
mdierolf / spotify.preload.c
Last active January 20, 2022 14:32
An LD_PRELOAD fix for a really stupid spotify problem
// Save this file somewhere as spotify.preload.c
// Then build the library:
// gcc -fPIC -shared -o ~/spotify.preload.so spotify.preload.c -ldl
// When you execute spotify, you need to preload this library, which wraps the "setsockopt" function call with another function that gives spotify the results it expects:
// LD_PRELOAD=~/spotify.preload.so spotify
// To make the desktop icon work, edit: /usr/share/applications/spotify.desktop
// Change Exec=... to: