Closed tomerrr closed 2 years ago
Hey, thanks for commenting, It means a lot. If you come across any bugs, don't be afraid to open an issue (or maybe even a PR :))
The other Spotify blockers are ancient, and don't work with Pipe wire, which is also what fedora uses AFAIK.
ok:) only thing missing (maybe) is a script to start spotify and spotblock-rs at the same time and also make sure both of them terminate when you exit spotify. this is what use running in a separated terminal window -
#!/bin/bash
# trap ctrl-c and call ctrl_c()
trap ctrl_c INT
function ctrl_c() {
echo "** Trapped CTRL-C"
killall spotify
killall spotblock-rs
exit
}
/usr/bin/spotify
/usr/local/bin/spotblock-rs &
while [ 1 ]
do
if pgrep -x spotify > /dev/null
then
sleep 0.5
else
killall spotblock-rs
exit
fi
done
`
Hey, i think that's a great idea.
ok:) only thing missing (maybe) is a script to start spotify and spotblock-rs at the same time and also make sure both of them terminate when you exit spotify. this is what use running in a separated terminal window -
#!/bin/bash # trap ctrl-c and call ctrl_c() trap ctrl_c INT function ctrl_c() { echo "** Trapped CTRL-C" killall spotify killall spotblock-rs exit } /usr/bin/spotify /usr/local/bin/spotblock-rs & while [ 1 ] do if pgrep -x spotify > /dev/null then sleep 0.5 else killall spotblock-rs exit fi done
`
I am not too familiar with shell scripting, however, wouldn't a solution like this be much better.
#!/bin/bash
spotblock &
/usr/bin/spotify
killall spotblock
and then maybe redirect the spotify.desktop file to this script. that way you can just run spotify through whichever application menu you use, and when you close spotify it will kill spotblock. That way it is less intrusive and you can pretend it's not even there
Okay added a run.sh
script that will run the adblocker and spotify, and kill the blocker afterwards
added a .desktop
file to run that script from your application menu
also added an install script to put the files in their correct locations
Hey, i think that's a great idea.
!/bin/bash
spotblock & /usr/bin/spotify killall spotblock
and then maybe redirect the spotify.desktop file to this script. that way you can just run spotify through whichever application menu you use, and when you close spotify it will kill spotblock. That way it is less intrusive and you can pretend it's not even there
i had cases where i closed spotify and spotblock was still running in memory for some reason, which is why i thought of this script which monitors whether spotify processes are running, and once they're killed - also kills spotblock. The Ctrl-C trap is because i'm running spotblock in a separated gnome terminal window, so i could see its prompts on mute and unmute , and I'd like ctrl-c to close that window and spotify itself.
So my .desktop file is (assuming the script above is stored in the user home directory as spotify-block.sh)
[Desktop Entry]
Name=Spotify spotblock
Exec=gnome-terminal --hide-menubar --title "Spotblock" -- /home/(your-username)/spotify-block.sh
Comment=
Terminal=false
Icon=spotify
Type=Application
EDIT: sorry, this is just my usage case where i run spotblock in a separate terminal so it over complicated the bash script a bit, your solution works just fine.
hi mate, 2 years late, Fedora 38 with Pulseaudio (i don't like Pipewire), just installed your last update from a year ago - ads are being muted perfectly. thanks a bunch!
i've tried all commercial mute options mentioned here https://wiki.archlinux.org/title/Spotify#Mute_commercials none of them worked for me (btw I use Fedora) , besides yours. thanks a bunch