This commit is contained in:
天クマ 2025-12-18 12:09:34 -03:00
commit c8734e660a
392 changed files with 21043 additions and 0 deletions

View file

@ -0,0 +1,52 @@
#!/bin/bash
status=$(playerctl -p spotify status)
if [[ -z $status ]]
then
exit
fi
if [[ $1 == "prev" ]]
then
playerctl -p spotify previous
sleep .1
# trigger the monitor to resync all
# spotify elements
pkill -RTMIN+4 waybar
exit
fi
if [[ $1 == "next" ]]
then
playerctl -p spotify next
sleep .1
# trigger the monitor to resync all
# spotify elements
pkill -RTMIN+4 waybar
exit
fi
# if no option is provided we toggle
# the play state and send a signal to
# waybar to update it's css.
if [[ $status == "Playing" ]]
then
playerctl -p spotify pause
sleep .1
# trigger the monitor to resync all
# spotify elements
pkill -RTMIN+4 waybar
exit
fi
if [[ $status == "Paused" ]]
then
playerctl -p spotify play
sleep .1
# trigger the monitor to resync all
# spotify elements
pkill -RTMIN+4 waybar
exit
fi

View file

@ -0,0 +1,27 @@
#!/bin/bash
status=$(playerctl -p spotify status)
artist=$(playerctl -p spotify metadata xesam:artist)
title=$(playerctl -p spotify metadata xesam:title)
album=$(playerctl -p spotify metadata xesam:album)
if [[ -z $status ]]
then
# spotify is dead, we should die to.
exit
fi
if [[ $status == "Playing" ]]
then
echo "{\"class\": \"playing\", \"text\": \"$artist - $title\", \"tooltip\": \"$artist - $title - $album\"}"
pkill -RTMIN+5 waybar
exit
fi
if [[ $status == "Paused" ]]
then
echo "{\"class\": \"paused\", \"text\": \"$artist - $title\", \"tooltip\": \"$artist - $title - $album\"}"
pkill -RTMIN+5 waybar
exit
fi

View file

@ -0,0 +1,18 @@
#!/bin/bash
# we are a clock for the other
# spotify elements.
#
# waybar will run this on an interval
# and external processes can trigger this
# with pkill -RTMIN+4 waybar
sleep .1
pkill -RTMIN+5 waybar
# if spotify is running, trigger the
# render of the "quit" element.
if pgrep spotify > /dev/null
then
pkill -RTMIN+6 waybar
fi

View file

@ -0,0 +1,20 @@
#!/bin/bash
status=$(playerctl -p spotify status)
if [[ -z $status ]]
then
exit
fi
if [[ $status == "Playing" ]]
then
echo "{\"class\": \"playing\", \"text\": \"\", \"tooltip\": \"$album\"}"
exit
fi
if [[ $status == "Paused" ]]
then
echo "{\"class\": \"paused\", \"text\": \"\", \"tooltip\": \"$album\"}"
exit
fi

View file

@ -0,0 +1,13 @@
#!/bin/bash
# quit closes spotify but triggers
# the monitor to update which immediately
# remove the widget instead of waiting for
# the next monitor interval.
if pgrep spotify
then
kill -SIGINT $(pgrep spotify)
fi
pkill -RTMIN+4 waybar