This repository has been archived on 2022-03-25. You can view files and clone it, but cannot push or open issues or pull requests.
manjaroConfiguration/installSpotify.sh

36 lines
1.5 KiB
Bash

# We make sure that Snap and flatpak versions are uninstalled
sudo snap remove spotify 2> /dev/null
sudo flatpak uninstall com.spotify.Client 2> /dev/null
# We install the version from the official website
which curl &> /dev/null || sudo apt update && sudo apt install curl -y # install curl if not already installed
echo "deb [trusted=yes] http://repository.spotify.com stable non-free" | sudo tee /etc/apt/sources.list.d/spotify.list
sudo apt update
sudo apt install spotify-client -y
echo -e "\nSpotify installed!"
# We install the prerequisites to build and install the patch (Git and Rust will be installed and not removed)
sudo apt install git make build-essential -y
which rustc &> /dev/null || wget -q --show-progress https://git.kennel.ml/Anri/myLinuxConfiguration/raw/branch/main/installRust.sh -O - | ( bash; source $HOME/.cargo/env ) # install rust if not already installed
# Download and build the patch
git clone https://github.com/abba23/spotify-adblock.git
cd spotify-adblock
make
# Install the patch
sudo make install
# Removing sourcecode folder
cd ..
rm -rf spotify-adblock
# We replace the Ubuntu desktop shortcut if needed
if [ -f /usr/share/applications/spotify.desktop ] ; then
sudo sed -i "7s#.*#Exec=env LD_PRELOAD=/usr/local/lib/spotify-adblock.so spotify %U#" /usr/share/applications/spotify.desktop
fi
# Remove banner
wget -q --show-progress https://git.kennel.ml/Anri/myLinuxConfiguration/raw/branch/main/removeBannerSpotify.sh -O - | bash
echo -e "\nSpotify patched! 🎉"