diff --git a/README.md b/README.md index 53cae20..bf37a11 100644 --- a/README.md +++ b/README.md @@ -1 +1,9 @@ -custom fortune list for fortune/misfortune that has every teto song on vocadb +custom fortune list and wrapper for fortune/misfortune that has every teto song on vocadb + +requires fortune/fortune-mod or misfortune installed. makefortune.sh requires fortune/fortune-mod to generate tetofortunes.dat. + +dowload installer.sh and run it, once finished you can get your teto song of the day by running: + +```bash +tetosong +``` diff --git a/installer.sh b/installer.sh index a056b21..b08a58c 100644 --- a/installer.sh +++ b/installer.sh @@ -1,43 +1,33 @@ #!/usr/bin/bash -# -# this one is going to get the fortune wrapper set up and all that good stuff. -# -# it needs to check if fortune is installed (or misfortune if not) ans then i need to find out how to find where the fortune files are installed (i have a misfortune folder, but i cant imagine fortune stores them in there) -# then i need to downlaod the tetofortunes and tetofortunes.dat files to that location -# -# then i need to write a script to ~/.local/bin caled tetosong that simply calls either fortune or misfortune (i'll check i guess?) -# - if ! [ -x "$(command -v fortune)" ]; then - echo 'fortune is not installed, checking for misfortune' >&2 + echo 'fortune is not installed, checking for misfortune'm if ! [ -x "$(command -v misfortune)" ]; then - echo 'neither program is installed, exiting' >&2 + echo 'neither program is installed, exiting' exit 1 else - echo 'misfortune found' >&2 + echo 'misfortune found' fi else - echo 'fortune found' >&2 + echo 'fortune found' fi - +echo "Downloading custom fortunes..." mkdir -p ~/.local/share/tetosong -curl -L -o ~/.local/share/tetosong/tetofortunes https://github.com/eric5949/TetoSongOfTheDay/raw/a52c877bfb1508f0223469e3b9e86c65ee6915ae/tetofortunes -curl -L -o ~/.local/share/tetosong/tetofortunes.dat https://github.com/eric5949/TetoSongOfTheDay/raw/a52c877bfb1508f0223469e3b9e86c65ee6915ae/tetofortunes.dat - +curl -s -L -o ~/.local/share/tetosong/tetofortunes https://github.com/eric5949/TetoSongOfTheDay/raw/a52c877bfb1508f0223469e3b9e86c65ee6915ae/tetofortunes +curl -s -L -o ~/.local/share/tetosong/tetofortunes.dat https://github.com/eric5949/TetoSongOfTheDay/raw/a52c877bfb1508f0223469e3b9e86c65ee6915ae/tetofortunes.dat +echo "writing tetosong to ~/.local/bin" +mkdir -p ~/.local/bin cat > ~/.local/bin/tetosong <&2 if ! [ -x "$(command -v misfortune)" ]; then - echo 'neither program is installed, exiting' >&2 + echo 'No fortune commmand is installed, exiting!' exit 1 + else + misfortune ~/.local/share/tetosong/tetofortunes fi else fortune ~/.local/share/tetosong/tetofortunes fi EOF - chmod +x ~/.local/bin/tetosong - - echo "you can get your Teto Song Of the Day by typing in tetosong or adding it to your bashrc :)"