big update

- added multiple teto voices based on the song returned by fortune
- moved files around for future flexibility
- added automakefortune service
This commit is contained in:
2026-04-25 11:19:43 -04:00
parent 4716231802
commit 86e986227f
14 changed files with 148 additions and 29 deletions

View File

@@ -4,7 +4,7 @@ while [[ $# -gt 0 ]]; do
case $1 in
-u|--update)
echo "Downloading tetosong updater..."
bash <(curl -s https://raw.githubusercontent.com/eric5949/tetosong/refs/heads/main/autoupdater/updater.sh)
bash <(curl -s https://raw.githubusercontent.com/eric5949/tetosong/refs/heads/test/autoupdater/updater.sh)
shift
exit 0
;;
@@ -26,7 +26,7 @@ done
# check if the config file exists, if not download it
if [ ! -f ~/.local/share/tetosong/tetosong.config ]; then
echo "Config file not found, downloading default..."
curl -sLo ~/.local/share/tetosong/tetosong.config https://raw.githubusercontent.com/eric5949/tetosong/refs/heads/main/tetosong.config
curl -sLo ~/.local/share/tetosong/tetosong.config https://raw.githubusercontent.com/eric5949/tetosong/refs/heads/test/tetosong.config
fi
# check if the user wants to play audio
AUDIO="$(. ~/.local/share/tetosong/tetosong.config; echo $AUDIO)"
@@ -37,14 +37,35 @@ if ! [ -x "$(command -v fortune)" ]; then
echo 'No fortune commmand is installed, exiting!'
exit 1
else
if [ "$AUDIO" = "YES" ]; then
nohup ffplay -nodisp -autoexit -v quiet ~/.local/share/tetosong/sv2SOTD.wav 2>/dev/null >/dev/null &
misfortune ~/.local/share/tetosong/fortunes/*/* >> /tmp/fortune # fortune and misfortune handle directories differently
if [ "$AUDIO" = "YES" ]; then # i guess i could foregoe checking and just run the audio either way since i dont download it unless the user enables it, but i want them to be ableto turn it off if they choose to
if grep -q "SV2" /tmp/fortune; then
nohup ffplay -nodisp -autoexit -v quiet ~/.local/share/tetosong/audio/teto/sv2SOTD.wav 2>/dev/null >/dev/null &
elif grep -q "SV" /tmp/fortune; then
nohup ffplay -nodisp -autoexit -v quiet ~/.local/share/tetosong/audio/teto/svSOTD.wav 2>/dev/null >/dev/null &
elif grep -q "重音テト" /tmp/fortune; then
nohup ffplay -nodisp -autoexit -v quiet ~/.local/share/tetosong/audio/teto/utSOTD.wav 2>/dev/null >/dev/null &
else
nohup ffplay -nodisp -autoexit -v quiet ~/.local/share/tetosong/audio/teto/sv2SOTD.wav 2>/dev/null >/dev/null &
fi
fi
misfortune ~/.local/share/tetosong/* # fortune doesnt care if you give it a directory, apparently misfortune does. watch this be a problem when i go to add SynthV Teto in a separate file.
cat /tmp/fortune
rm /tmp/fortune
fi
else
fortune ~/.local/share/tetosong/fortunes/* >> /tmp/fortune
if [ "$AUDIO" = "YES" ]; then
nohup ffplay -nodisp -autoexit -v quiet ~/.local/share/tetosong/sv2SOTD.wav 2>/dev/null >/dev/null &
if grep -q "SV2" /tmp/fortune; then
nohup ffplay -nodisp -autoexit -v quiet ~/.local/share/tetosong/audio/teto/sv2SOTD.wav 2>/dev/null >/dev/null &
elif grep -q "SV" /tmp/fortune; then
nohup ffplay -nodisp -autoexit -v quiet ~/.local/share/tetosong/audio/teto/svSOTD.wav 2>/dev/null >/dev/null &
elif grep -q "重音テト" /tmp/fortune; then
nohup ffplay -nodisp -autoexit -v quiet ~/.local/share/tetosong/audio/teto/utSOTD.wav 2>/dev/null >/dev/null &
else
nohup ffplay -nodisp -autoexit -v quiet ~/.local/share/tetosong/audio/teto/sv2SOTD.wav 2>/dev/null >/dev/null &
fi
fi
fortune ~/.local/share/tetosong
cat /tmp/fortune
rm /tmp/fortune
fi