-
Notifications
You must be signed in to change notification settings - Fork 2
/
mainloop.sh
executable file
·29 lines (22 loc) · 771 Bytes
/
mainloop.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
#!/bin/zsh
if [ -f $HOME/opt/lib/libpiehid.so ]; then
echo "Setting LD_LIBRARY_PATH to point to $HOME/opt/lib to pick up libpiehid.so"
export LD_LIBRARY_PATH=$HOME/opt/lib:$LD_LIBRARY_PATH
else
echo "No local libpiehid.so found, trying global..."
fi
cd $(dirname $(realpath $0))
while true; do
sleep 1
kill -9 $(jobs -p)
rm --force --one-file-system **/*.pyc
# rm ~/dragonshare/NatLink/NatLink/MacroSystem/*.pyc
#touch ~/dragonshare/NatLink/NatLink/MacroSystem/*.py
# Let ctrl-c pass through to python so we can use it
# to trigger restarts
TRAPINT() {}
python2 MainThread.py
# but only when python is running, this way if we
# hold control-c we still quit the whole loop
unfunction TRAPINT
done