-
Notifications
You must be signed in to change notification settings - Fork 3
/
start.sh
executable file
·99 lines (84 loc) · 1.96 KB
/
start.sh
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
## Define the functions
datetime ()
{
python3 ./scripts/date_time/date_time.py
cp ./scripts/date_time/date_time.png ./info-beamer/date_time.png
}
forecast ()
{
python3 ./scripts/forecast/forecast.py
cp ./scripts/forecast/forecast.png ./info-beamer/forecast.png
}
gcalendar ()
{
python3 ./scripts/gcalendar/gcalendar.py
cp ./scripts/gcalendar/gcalendar.png ./info-beamer/gcalendar.png
}
rss_aj ()
{
python3 ./scripts/rss_aj/rss_aj.py
cp ./scripts/rss_aj/imgs/* ./info-beamer/news/
}
rss_ts ()
{
python3 ./scripts/rss_ts/rss_ts.py
cp ./scripts/rss_ts/imgs/* ./info-beamer/news/
}
notes ()
{
python3 ./scripts/notes/notes.py
cp ./scripts/notes/notes.json ./info-beamer/notes/notes.json
}
vbb ()
{
python3 ./scripts/vbb/vbb.py
cp ./scripts/vbb/vbb.png ./info-beamer/vbb.png
}
weather ()
{
python3 ./scripts/weather/weather.py
cp ./scripts/weather/weather.png ./info-beamer/weather.png
}
## Main Script
info-beamer info-beamer/. >/dev/null 2>&1 &
elapsed=0
while true
do
if (( $elapsed % 60 == 0))
then
weather
echo "[Weather]: updated at $(date +%H:%M:%S)"
fi
if (( $elapsed % 10 == 0))
then
datetime
echo "[Time]: updated at $(date +%H:%M:%S)"
fi
if (( $elapsed % (60*60) == 0))
then
gcalendar
echo "[Calendar]: updated at $(date +%H:%M:%S)"
fi
if (( $elapsed % 60 == 0))
then
forecast
echo "[Forecast]: updated at $(date +%H:%M:%S)"
fi
if (( $elapsed % 30 == 0))
then
vbb
echo "[Traffic]: updated at $(date +%H:%M:%S)"
fi
if (( $elapsed % (60*60) == 0))
then
rss_ts
echo "[News]: updated at $(date +%H:%M:%S)"
fi
if (( $elapsed % (60*2) == 0))
then
notes
echo "[Notes]: updated at $(date +%H:%M:%S)"
fi
sleep 1
elapsed=$(($elapsed+1))
done