diff options
| author | stkhan <personal@slickd.xyz> | 2024-05-06 14:38:44 -0500 |
|---|---|---|
| committer | stkhan <personal@slickd.xyz> | 2024-05-06 14:38:44 -0500 |
| commit | 98cf2587909cc94ea1b7dafe0760fd49f21b68f9 (patch) | |
| tree | c223bb2d83a408fb9d99f3a36731b91f5e1ce9bb | |
| parent | 11869ffbf373829d48df981f9890f948681b7e8e (diff) | |
0.0.3
| -rw-r--r-- | Makefile | 15 | ||||
| -rwxr-xr-x | nws | 10 | ||||
| -rw-r--r-- | nws.conf | 3 |
3 files changed, 22 insertions, 6 deletions
@@ -1,6 +1,13 @@ -all: - cp nws ~/.local/bin/ - cp nws.conf ~/.config/ +PREFIX=/usr/local/bin + +all: install + +install: + mkdir -p ${PREFIX}/ + cp nws ${PREFIX}/ remove: - rm -rf ~/.local/bin/nws + rm -rf ${PREFIX}/nws +config: + mkdir -p ~/.config/nws/ + cp nws.conf ~/.config/nws/ @@ -2,7 +2,8 @@ # nws - a National Weather Service terminal client # git.slickd.xyz/nws -source ~/.config/nws.conf +source ~/.config/nws/nws.conf +version=v0.0.3 colors() { NOCOLOR='\033[0m' @@ -101,6 +102,8 @@ get_graphicast() { prog=$(echo "$prog + 12.5" | bc) bar="${bar}#" done + echo "Getting Mesonet radar..." + wget -q -P /tmp/nws https://data.mesonet.org/data/nids/maps/realtime/${state_full}.MosaicBREF.png $IV /tmp/nws/* } @@ -129,7 +132,8 @@ get_forecast() { } help() { - echo "nws" + echo "nws $version" + echo echo " --radar (1,2,3): shows local radar" echo " --spc: shows storm predictions" echo " --retrieve-counties: shows county ids" @@ -137,6 +141,7 @@ help() { echo " --gc: shows graphic forecast, uses image viewer set in config" echo " -a: shows alerts" echo " -f: shows local forecast" + echo } cleanup radar_choice=$2 @@ -149,5 +154,6 @@ case $1 in '-a') show_alerts | sed 's/null//g ; s/"//g' |less -R;; '-f') get_forecast | sed 's/"//g ; s/null/0/g' | less -R;; '-h') help;; + '--help') help;; "") help;; esac @@ -4,6 +4,9 @@ IV="nsxiv" # two letter state code state="OK" +# full state name, must have first letter capitalized +state_full="Oklahoma" + # options include SOUTHPLAINS, SOUTHROCKIES, NORTHEAST, NORTHROCKIES, etc - https://radar.weather.gov/ridge/standard/ area1="SOUTHPLAINS" |