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

37 lines
1.5 KiB
Bash
Raw Normal View History

2021-11-14 00:44:24 +01:00
# 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
2021-12-28 17:05:59 +01:00
2021-11-14 00:44:24 +01:00
# We install the version from the official website
2021-12-28 17:05:59 +01:00
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!"
2021-11-14 00:44:24 +01:00
# 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
2021-12-28 17:05:59 +01:00
2021-11-14 00:44:24 +01:00
# Download and build the patch
git clone https://github.com/abba23/spotify-adblock.git
cd spotify-adblock
make
2021-12-28 17:05:59 +01:00
2021-11-14 00:44:24 +01:00
# Install the patch
sudo make install
2021-12-28 17:05:59 +01:00
2021-11-14 00:44:24 +01:00
# Removing sourcecode folder
cd ..
rm -rf spotify-adblock
2021-12-28 17:05:59 +01:00
# We replace the Ubuntu desktop shortcut if needed
2021-11-14 22:17:42 +01:00
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! 🎉"