First off, add this DNF repository to the repository list of the system’s package manager:
sudo dnf config-manager --add-repo https://negativo17.org/repos/fedora-spotify.repo
It provides repackaged Spotify’s Ubuntu binaries for Fedora, thanks to @scaronni
. Here’s the project’s page. These binaries are easier to handle, contrary to the ones from the RPMFusion repository.
Now you can install the Spotify client:
sudo dnf install spotify
Launch the application and login into your account. It will create the ~/.config/spotify
directory, including some files we will need later.
Close the application. We will handle blocking the ads now.
Checkout this repository (thanks to @abba23), build and install the shared library it provides:
git clone https://github.com/abba23/spotify-adblock.git
cd spotify-adblock
make
sudo make install
Note that it needs Make and a Rust toolchain.
The shared library object will be installed in /usr/local/lib/spotify-adblock.so
. To use it, edit the client’s wrapper script:
sudo nano /usr/bin/spotify
You can trick the symbols resolution at runtime by adding the following local environment variable before the exec
statements:
# Other `export`s
# <...>
export LD_PRELOAD=/usr/local/lib/spotify-adblock.so
# `exec` statements
# <...>
The last thing to do is to remove ads placeholders and some other annoyances (like the Upgrade button) from the client.
Install spicetify-cli
by grabbing an archive of a release. Unpack it and add the binary’s directory to your PATH
. Add permissions to change the Spotify files:
sudo chmod a+wr /usr/lib64/spotify-client
sudo chmod a+wr /usr/lib64/spotify-client/Apps -R
Here’s a theme we can use, thanks to @Daksh777. Checkout the repository, copy the color.ini
and user.css
files to a directory inside ~/.config/spicetify/Themes
. The name of the directory defines the name of the theme.
Configure Spicetify to use that theme:
spicetify config current_theme ${THEME_NAME}
Now, before applying it, set the Spotify client’s location in the Spicetify’s config. Go to ~/.config/spicetify/config-xpui.ini
and edit the following lines:
# <...>
prefs_path = ${HOME}/.config/spotify/prefs
# <...>
spotify_path = /usr/lib64/spotify-client
# <...>
Note that you will need to expand the ${HOME}
variable in this file.
Now backup the installation and apply the theme:
spicetify backup
spicetify apply
In case there is an update of the app, you will need to re-edit the wrapper script, re-add permissions, and re-apply the theme. That’s it, enjoy!
Install the flatpak package from Flathub, launch it and login into your account. This will create session files we will need later. After that, close the application.
Grab the shared library spotify-adblock.so
from the latest release of spotify-adblock
(thanks to @abba23). It’s built on the same runtime the Spotify Flatpak version uses. Put it in any directory (we will use ~/.spotify-adblock
here for simplicity).
Also, grab the configuration file config.toml
from the latest commit and put it in ~/.config/spotify-adblock
.
Give Spotify permissions to read these directories:
flatpak override --user \
--filesystem="~/.spotify-adblock/spotify-adblock.so" \
--filesystem="~/.config/spotify-adblock/config.toml" \
com.spotify.Client
Note that you can do this using Flatseal.
You should now be able to run Spotify without ads by executing
flatpak run --command=sh com.spotify.Client \
-c 'eval "$(sed s#LD_PRELOAD=#LD_PRELOAD=${HOME}/.spotify-adblock/spotify-adblock.so:#g /app/bin/spotify)"'
This hook is needed since Flatpaks tend to update their files. For your convenience, you can override the desktop file provided by Spotify, so that this hook executes each time you launch the application.
Before we do this, let’s define a temporary variable for the path of the Spotify Flatpak:
SPOTIFY_PATH=/var/lib/flatpak/app/com.spotify.Client/current/active/
Let’s copy the desktop file:
cp ${SPOTIFY_PATH}/export/share/applications/com.spotify.Client.desktop ~/.local/share/applications
Edit this copy by changing the Exec
statement to the following line:
Exec=/usr/bin/flatpak run --branch=stable --command=sh --file-forwarding com.spotify.Client -c 'eval "$(sed s#LD_PRELOAD=#LD_PRELOAD=${HOME}/.spotify-adblock/spotify-adblock.so:#g /app/bin/spotify)"' @@u %U @@
That’s all with ads, but we still need to remove placeholders from the application.
Install spicetify-cli
by grabbing an archive of a release. Unpack it and add the binary’s directory to your PATH
. Add permissions to change the Spotify files:
sudo chmod a+wr ${SPOTIFY_PATH}/files/extra/share/spotify
sudo chmod a+wr ${SPOTIFY_PATH}/files/extra/share/spotify/Apps -R
Here’s a theme we can use, thanks to @Daksh777. Checkout the repository, copy the color.ini
and user.css
files to a directory inside ~/.config/spicetify/Themes
. The name of the directory defines the name of the theme.
Configure Spicetify to use that theme:
spicetify config current_theme ${THEME_NAME}
Now, before applying it, set the Spotify client’s location in the Spicetify’s config. Go to ~/.config/spicetify/config-xpui.ini
and edit the following lines:
# <...>
prefs_path = ${HOME}/.config/spotify/prefs
# <...>
spotify_path = ${SPOTIFY_PATH}/files/extra/share/spotify
# <...>
Note that you will need to expand the ${HOME}
and ${SPOTIFY_PATH}
variables in this file.
Now backup the installation and apply the theme:
spicetify backup
spicetify apply
In case there is an update of the app, you will need to re-add permissions and re-apply the theme. That’s it, enjoy!