-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkiosk.sh
51 lines (39 loc) · 1.24 KB
/
kiosk.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
#!/bin/bash
xset s noblank
xset s off
xset -dpms
unclutter -idle 0.5 -root &
sed -i 's/"exited_cleanly":false/"exited_cleanly":true/' /home/pi/.config/chromium/Default/Preferences
sed -i 's/"exit_type":"Crashed"/"exit_type":"Normal"/' /home/pi/.config/chromium/Default/Preferences
# this file will be created by createURLList.py
# and will contain the bash script used
# to open Chromium with the tabs populated
FILE=/home/pi/kiosk/start_browser.sh
# Create the URL script. This will keep trying until it passes
# typically fails on the first try because the internet is
# is not quite ready and createURLList.py can grab the web page it needs
B_SUCCESS=false
#have to initialize retCode, if not then later statement will always be 0
retCode=2
while [ ! $B_SUCCESS = true ]
do
python3 /home/pi/kiosk/createURLList.py
#get return code
retCode=$?
if [ $retCode = 0 ]; then
B_SUCCESS=true
else
B_SUCCESS=false
sleep 5
fi
done
#Make file executable
chmod +x "$FILE"
#And execute it. The & makes it run in it's own session
source "$FILE" &
#this will issue a ctrl-TAB every xx seconds which will cycle
#through the pages on Chromium
while true; do
xdotool keydown ctrl+Tab; xdotool keyup ctrl+Tab;
sleep 8
done