Enable users to inject a custom script to start KlipperScreen (#660)
A helper script is included to ease migration for the common Android XSDL use-case
This commit is contained in:
1 parent
5e73fb03b5
commit
2fd5e6e89f
3 files changed
+51
-1
No files matched your search
Executable
+37
@@ -0,0 +1,37 @@
|
||||
# A wrapper for the popular script for KlipperScreen on Android over adb over USB.
|
||||
# https://klipper.discourse.group/t/how-to-klipperscreen-on-android-smart-phones/1196
|
||||
#
|
||||
# Keeps the process alive while the server is active
|
||||
# to mimic default X's behaviour and keep the service happy
|
||||
|
||||
./lauch_klipperscreen.sh
|
||||
|
||||
ret=1
|
||||
timeout=0
|
||||
echo -n "Waiting for X-server to be ready "
|
||||
while [ $ret -gt 0 ] && [ $timeout -lt 60 ]
|
||||
do
|
||||
xset -display :100 -q > /dev/null 2>&1
|
||||
ret=$?
|
||||
timeout=$( expr $timeout + 1 )
|
||||
echo -n "."
|
||||
sleep 1
|
||||
done
|
||||
echo ""
|
||||
if [ $timeout -lt 60 ]
|
||||
then
|
||||
echo -n "X server found. Monitoring connection"
|
||||
ret=0
|
||||
while [ $ret -eq 0 ]
|
||||
do
|
||||
xset -display :100 -q > /dev/null 2>&1
|
||||
ret=$?
|
||||
sleep 60
|
||||
done
|
||||
echo -n "X Server connection lost"
|
||||
exit 0
|
||||
|
||||
else
|
||||
echo -n "X server not found"
|
||||
exit 1
|
||||
fi
|
||||
Reference in new issue
Block a user