Delete cscnp.sh

This commit is contained in:
kittenlikeasmallcat 2022-01-21 23:02:22 -08:00 committed by GitHub
parent c2133940cc
commit 7bd9c495fd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,59 +0,0 @@
#!/bin/bash
## ~/.local/bin/5nowplaying.sh ##
ad(){ #is spotify trying to sell me something and calling it a song?
local SONG=$( eval spotifycli --song )
test
[[ $SONG == "Advertisement" ]]
}
checkmute(){ # am I muted already? returns 1 if unmuted. !checkmute means muted
test
[[ $( eval amixer -D pulse sget Master | grep -F [on] ) ]]
}
ifad(){ #prints now playing for clementine, "muted," and cmus
local C=$( np -n )
local M="MUTED ·"
local CMUS=$( tail -n 1 ~/.cmus/now-playing )
echo -n $C $M $CMUS
}
ifnoad(){ #prints now playing for clementine, spotify, and cmus
local C=$( np -n )
local S=$( spotifycli --status )
local CMUS=$( tail -n 1 ~/.cmus/now-playing )
echo -n $C $S $CMUS
}
if ad ; then ifad ;
elif ! ad ; then ifnoad;
else ifnoad ; fi #something's gone wrong
while ad && checkmute ; #if there's an ad and alsa is unmuted, runs fuckads.sh
do
# fuckads.sh #
toggle(){ #flip the switch
amixer -q -D pulse sset Master toggle
}
if ad ; then #yea spotify is trying to sell me something
while ad ; #right now?
do
if checkmute ; #am I muted yet?
then
toggle && notify-send "🔇FUCKADS🔇 MUTING THAT SHIT" ; #mute
sleep 30 #each ad is like 30 secs
fi; continue; # another one ??
done;
while ! ad ; #ok spotify isn't trying to sell me something
do
if ! checkmute ; #am I still muted?
then
toggle && notify-send "✅FUCKADS✅ MUTED THAT SHIT" ; #unmute
sleep 30 #wait to check for another ad
fi
done
fi
break; sleep 30 ; done #waits 30 seconds before checking and unmuting