-
Notifications
You must be signed in to change notification settings - Fork 67
/
run.sh
executable file
·60 lines (47 loc) · 1.75 KB
/
run.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
. env.sh
function log {
echo "---------------------------------------"
echo ${1^^}
echo "---------------------------------------"
}
if [ $WAVESHARE_EPD75_VERSION = 1 ]; then
export WAVESHARE_WIDTH=640
export WAVESHARE_HEIGHT=384
else
export WAVESHARE_WIDTH=800
export WAVESHARE_HEIGHT=480
fi
if [ $PRIVACY_MODE_XKCD = 1 ]; then
log "Get XKCD comic strip"
.venv/bin/python3 xkcd_get.py
if [ $? -eq 0 ]; then
.venv/bin/python3 display.py xkcd-comic-strip.png
fi
elif [ $PRIVACY_MODE_LITERATURE_CLOCK = 1 ]; then
log "Get Literature Clock"
.venv/bin/python3 screen-literature-clock-get.py
if [ $? -eq 0 ]; then
.venv/bin/cairosvg -o screen-literature-clock.png -f png --dpi 300 --output-width $WAVESHARE_WIDTH --output-height $WAVESHARE_HEIGHT screen-literature-clock.svg
.venv/bin/python3 display.py screen-literature-clock.png
fi
else
log "Add weather info"
.venv/bin/python3 screen-weather-get.py
log "Add Calendar info"
.venv/bin/python3 screen-calendar-get.py
# Only layout 5 shows a calendar, so save a few seconds.
if [ "$SCREEN_LAYOUT" -eq 5 ]; then
log "Add Calendar month"
.venv/bin/python3 screen-calendar-month.py
fi
if [ -f screen-custom-get.py ]; then
log "Add Custom data"
.venv/bin/python3 screen-custom-get.py
elif [ ! -f screen-output-custom-temp.svg ]; then
# Create temporary empty svg since the main SVG needs it
echo "<svg />" > screen-output-custom-temp.svg
fi
log "Export to PNG"
.venv/bin/cairosvg -o screen-output.png -f png --dpi 300 --output-width $WAVESHARE_WIDTH --output-height $WAVESHARE_HEIGHT screen-output-weather.svg
.venv/bin/python3 display.py screen-output.png
fi