Created
June 18, 2021 21:38
-
-
Save rojenzaman/654b0e183ad8f0d5d9d65c158dfe4c5d to your computer and use it in GitHub Desktop.
Revisions
-
rojenzaman created this gist
Jun 18, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,76 @@ # Spotify Adblock Fedora 34 ## Install Spotify First install the spotify package from [negativo17](https://negativo17.org/spotify-client/)'s repository. Enable negativo17 repo: ```bash dnf config-manager --add-repo=https://negativo17.org/repos/fedora-spotify.repo ``` Then install: ```bash dnf install spotify-client ``` ## Build Adblock Install the dependencies: ```bash dnf install rust cargo ``` Clone and build: ```bash git clone https://github.com/abba23/spotify-adblock.git cd spotify-adblock make ``` Install to system path: ```bash sudo make install ``` ## Usage - Important Last Step Normally on other GNU/Linux distribution users add the `LD_PRELOAD` value to the desktop file, but this method didn't work on Fedora 34 (I really don't know why). So we will add `LD_PRELOAD` to spotify's executable: `/usr/bin/spotify`. Add `LD_PRELOAD` value to `/usr/bin/spotify`: ```bash export LD_PRELOAD=/usr/local/lib/spotify-adblock.so ``` Look like this: ```bash #!/usr/bin/sh # Wrapper script for Spotify. # The spotify binary has a RUNPATH of its origin folder. It requires a few # librares compiled with minimum options (no external dependencies). # The FFMpeg library is loaded ONLY on the system path libraries, ignoring the # RUNPATH. # So remove the RUNPATH from the binary, put all the libraries in its private # folder and make sure that only the spotify binary can access them. export LD_LIBRARY_PATH="/usr/lib64/spotify-client${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" export SCALE_FACTOR="$(/usr/lib64/spotify-client/get-scale-factor.py)" #HERE export LD_PRELOAD=/usr/local/lib/spotify-adblock.so exec /usr/lib64/spotify-client/spotify --force-device-scale-factor=$SCALE_FACTOR "$@" & exec /usr/lib64/spotify-client/set-dark-theme-variant.py & ``` That's all! Run it. 