-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun
executable file
·81 lines (73 loc) · 1.96 KB
/
run
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
#!/bin/bash
project="Lumen"
arch="x64"
bold() { tput bold; echo $@; tput sgr0; }
# make project
cd src
make clean
make
out=$?
cd ..
if [ $out != 0 ]; then exit; fi
# make splash screen
cd splash
#make clean
make
out=$?
cd ..
if [ $out != 0 ]; then exit; fi
runLumen() {
echo
fails=0
fails2=0
while :
do
sleep 2
clear
# attempt to detect the hidraw of Vuzix Wrap 920 AR
hidraw="/dev/$( realpath /sys/class/hidraw/hidraw* | grep 1BAE:014B | grep -o hidraw[0-9]$ )"
if [ "$hidraw" != "/dev/" ]; then
sudo chmod +r $hidraw
if [ "$?" == "0" ]; then
bold "Starting Lumen..."
cd bin/$arch-Release
./$project $hidraw #&>> ../../lumen.log
if [ "$?" != "1" ]; then
bold "Starting Lumen failed... (check camera and Kinect connections)"
let "fails+=1"
if [ $fails -gt 3 ]; then
let "fails2+=1"
if [ $fails2 -gt 3 ]; then
echo
bold "We have a problem. Rebooting now... that should fix it."
bold "Unfortunately this happens once in a while."
sleep 7
sudo reboot
fi
bold "Attempting to recover graphics"
sleep 1
openbox --restart
fi
else
cd ../..
break
fi
cd ../..
fi
else
bold "Attempting connection to 3D glasses... (check glasses connections)"
fi
done
}
#while :
#do
# Run lumen
runLumen
# Splash screen
#echo
#bold Starting Splash...
#cd splash
#./LumenSplash
#if [ "$?" == "77" ]; then exit; fi # press "5" in splash to get out of here ;)
#cd ..
#done