pinwheel: Escape spotify output

To get around trouble parsing e.g. `&`
This commit is contained in:
Alexander Heldt
2023-09-19 22:41:33 +02:00
parent 3dacad1372
commit d415f69126

View File

@@ -6,15 +6,14 @@ let
if [ "$STATUS" = "No players found" ]; then if [ "$STATUS" = "No players found" ]; then
echo " " echo " "
else else
TITLE=$(${pkgs.playerctl}/bin/playerctl -p spotify metadata xesam:title) FORMAT="{{markup_escape(xesam:title)}} - {{markup_escape(xesam:artist)}}"
ARTIST=$(${pkgs.playerctl}/bin/playerctl -p spotify metadata xesam:artist) OUTPUT=$(${pkgs.playerctl}/bin/playerctl -p spotify metadata --format "$FORMAT")
case "$STATUS" in case "$STATUS" in
"Playing") "Playing")
echo "<span font='14' rise='-3000'></span> $TITLE - $ARTIST" echo "<span font='14' rise='-3000'></span> $OUTPUT"
;; ;;
"Paused") "Paused")
echo "<span font='14' rise='-3000'></span> $TITLE - $ARTIST" echo "<span font='14' rise='-3000'></span> $OUTPUT"
;; ;;
*) *)
echo " " echo " "