Polybar/team_tomodachi/team_tomodachi_ascii.sh
soku 0e17d45cf0 team_tomodachi_ascii.sh
Added for availability
2025-05-08 07:22:36 +00:00

40 lines
1.3 KiB
Bash
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env bash
# Temp File to save a state, Polybar makes a variable loop impossible
# unless we pull the value from outside of our script in another file.
TEMP=/tmp/polybar_team_tomodachi
# Initialize state if missing
if [[ ! -f $TEMP ]]; then
echo 1 > "$TEMP"
fi
# Read TEMP, increment, write and exit.
STATE=$(<"$TEMP")
# compute next: 1→ 2, 2→ 1
NEXT=$(( STATE % 5 + 1 ))
echo $NEXT > "$TEMP"
# Otherwise, just read the state and print
STATE=$(<"$TEMP")
# Going to use TEMP here to pick our case;
case "$STATE" in
1)
echo "%{T1}%{F#9933ff}チーム・トモダチ%{F-} %{F#2BB1DA}(˶˃ ᵕ ˂˶)%{F-}%{T-}    TEAM TOMODACHI"
;;
2)
echo "%{T1}%{F#9933ff}チーム・トモダチ%{F-} %{F#2BB1DA}(˶˃ ᵕ ˂˶)%{F-}%{F#FFFF00}⋆˙⟡%{F-}%{T-}   TEAM TOMODACHI"
;;
3)
echo "%{T1}%{F#9933ff}チーム・トモダチ%{F-} %{F#2BB1DA}(˶˃ ᵕ ˂˶)%{F-}%{T-}   TEAM TOMODACHI"
;;
4)
echo "%{T1}%{F#9933ff}チーム・トモダチ%{F-} %{F#FFFF00}⋆˙⟡ %{F-}%{F#2BB1DA}(˶˃ ᵕ ˂˶)%{F-}%{T-} TEAM TOMODACHI"
;;
5)
echo "%{T1}%{F#9933ff}チーム・トモダチ%{F-} %{F#FFFF00}✧ %{F-}%{F#2BB1DA}(˵ •̀ ᴗ - ˵ )%{F-} %{F#FFFF00}✧%{F-}%{T-} TEAM TOMODACHI"
;;
*)
echo "Value '$STATE' not in 15"
;;
esac