summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile15
-rwxr-xr-xnws10
-rw-r--r--nws.conf3
3 files changed, 22 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index f38b8da..900a142 100644
--- a/Makefile
+++ b/Makefile
@@ -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/
diff --git a/nws b/nws
index 53289e4..c4c5d17 100755
--- a/nws
+++ b/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
diff --git a/nws.conf b/nws.conf
index 2926440..596d539 100644
--- a/nws.conf
+++ b/nws.conf
@@ -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"