forked from CamilleScholtz/bin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
raingraph
executable file
·40 lines (34 loc) · 883 Bytes
/
raingraph
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/fish
#
# raingraph - Create graph with raininfo
# onodera, https://github.com/onodera-punpun
## FUNCTIONS
# This function creates the graph
function graph
gnuplot -e "set terminal png transparent size 195,135;\
set yrange [0:255];\
set noborder;\
set nolabel;\
set nokey;\
set notics;\
set notitle;\
set style fill solid border rgb '#BC846F';\
plot '$rainfile' smooth csplines with filledcurve x1 lc rgb '#E5AB96'"
end
## EXECUTE
# Download weather info
set rainfile /tmp/rain.txt
wget -q -O- "http://gps.buienradar.nl/getrr.php?lat=52.0646&lon=5.2065" | sed "s/|.*//g" > $rainfile
if test (count $argv) -ge 1
switch $argv[1]
case -h --help
echo -e "Usage: raingraph [location]\n"
echo "options:"
echo " -h, --help print help and exit"
exit 0
case "*"
graph > $argv
end
else
graph > raingraph.png
end