Skip to content

Instantly share code, notes, and snippets.

@selectric401
Last active March 13, 2020 19:05
Show Gist options
  • Save selectric401/6a08ecfa5739ddb7656aa67abfa23816 to your computer and use it in GitHub Desktop.
Save selectric401/6a08ecfa5739ddb7656aa67abfa23816 to your computer and use it in GitHub Desktop.
stonks.sh - a wrapper for ticker.sh
#!/bin/bash
# stonks.sh
# requires ticker.sh from https://github.com/pstadler/ticker.sh
#
COLOR_BOLD="\e[38;5;248m"
COLOR_GREEN="\e[38;5;154m"
COLOR_RED="\e[38;5;202m"
STONKS="^DJI ^GSPC ^IXIC USDEUR=X USDGBP=X"
if [[ $1 == "" ]]; then
$HOME/bin/ticker.sh ${STONKS};
exit;
fi
while getopts ":fh" opt; do
case $opt in
f)
watch -n 5 -t -c $HOME/bin/ticker.sh ${STONKS}
;;
h)
echo "stonks.sh help"
echo "Set variable STONKS to tickers you want to see"
echo ""
echo "Flags:"
echo "-f live update every 5 seconds"
echo ""
exit 0
;;
\?)
echo "Invalid option"
exit 1
;;
esac
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment