2022-02-18 23:39:38 +00:00
|
|
|
GNU nano 6.1 /home/ktn/.local/bin/nowplaying
|
2022-01-22 07:01:42 +00:00
|
|
|
#!/bin/bash
|
|
|
|
SONG=$( cat ~/.nowplaying2.tmp )
|
|
|
|
#while :; do
|
2022-02-18 23:39:38 +00:00
|
|
|
|
2022-01-22 07:01:42 +00:00
|
|
|
if ! $(pgrep -x "spotify" >/dev/null) ; then
|
2022-02-18 23:39:38 +00:00
|
|
|
if ! $(pgrep -x "cmus" >/dev/null) && $(pgrep -x "clementine" >/dev/null); then
|
|
|
|
echo -n $(np -n 2>/dev/null)
|
|
|
|
echo -n "spotify is off as fuck" > ~/.nowplaying2.tmp
|
|
|
|
#echo "error1";
|
|
|
|
elif ! $(pgrep -x "clementine" >/dev/null) && $(pgrep -x "cmus" >/dev/null); then
|
|
|
|
tail -z ~/.cmus/now-playing
|
|
|
|
echo -n "spotify is off as fuck" > ~/.nowplaying2.tmp
|
|
|
|
else
|
|
|
|
tail -z ~/.cmus/now-playing & echo -n $(np -n 2>/dev/null);
|
|
|
|
echo -n "spotify is off as fuck" > ~/.nowplaying2.tmp
|
|
|
|
fi
|
2022-01-22 07:01:42 +00:00
|
|
|
elif $(pidof -x "spotify">/dev/null ) ; then
|
2022-02-18 23:39:38 +00:00
|
|
|
# echo -n $( spotifycli --status ) > ~/.nowplaying2.tmp ;
|
|
|
|
echo $( spotifycli --status ) > ~/.nowplaying2.tmp ;
|
2022-01-22 07:01:42 +00:00
|
|
|
|
|
|
|
case $SONG in
|
2022-02-18 23:39:38 +00:00
|
|
|
"-" | "- Shop DGDG.com" | "- Advertisement" | "Advertisement" )
|
2022-01-22 07:01:42 +00:00
|
|
|
tail -z ~/.cmus/now-playing & echo -n $(np -n 2>/dev/null);
|
2022-02-18 23:39:38 +00:00
|
|
|
echo 'AD MUTED·' ; #&& echo 'AD MUTED·' > ~/.nowplaying2.tmp
|
2022-01-22 07:01:42 +00:00
|
|
|
#echo "error2";
|
|
|
|
;;
|
|
|
|
"spotify is off as fuck" )
|
|
|
|
tail -z ~/.cmus/now-playing & echo -n $(np -n 2>/dev/null);
|
|
|
|
echo "error3";
|
|
|
|
;;
|
|
|
|
* )
|
|
|
|
tail -z ~/.cmus/now-playing & echo -n $(np -n 2>/dev/null);
|
|
|
|
echo $(spotifycli --status)
|
|
|
|
#echo "error4";
|
|
|
|
;;
|
|
|
|
esac;
|
2022-02-18 23:39:38 +00:00
|
|
|
|
|
|
|
echo -n $( spotifycli --status ) > ~/.nowplaying2.tmp ;
|
2022-01-22 07:01:42 +00:00
|
|
|
fi
|
|
|
|
#sleep 2; done
|