diff --git a/app/plugins/screens/device_install.py b/app/plugins/screens/device_install.py index 845de4c..40e15ec 100644 --- a/app/plugins/screens/device_install.py +++ b/app/plugins/screens/device_install.py @@ -11,7 +11,7 @@ def read(id=False): # GET return {"text": "This is the Device onboarding script that you can run on e.g. a raspberry pi.
Nothing else to do here.

Open Bash Install Script"} else: script=""" -apt install unclutter xdotool +apt install unclutter xdotool wtype mkdir -p /etc/chromium/policies/managed /etc/chromium/policies/recommended mkdir -p /home/pi/.config/lxsession/LXDE-pi/ @@ -23,12 +23,15 @@ def read(id=False): # GET #!/bin/bash export XAUTHORITY=/home/pi/.Xauthority export DISPLAY=:0 -#xdotool search --onlyvisible --class chromium windowfocus key F5 -xdotool search --onlyvisible --class chromium windowfocus key ctrl+t +# open new tab loading the default page again +wtype -M ctrl -P t -p t -m ctrl sleep 2 -xdotool search --onlyvisible --class chromium windowfocus key ctrl+Tab +# switch back to old tab, new tab is invisible +wtype -M ctrl -P tab -p tab -m ctrl +# wait for new tab to load sleep 30 -xdotool search --onlyvisible --class chromium windowfocus key ctrl+w +# kill old tab, new one will be showing again +wtype -M ctrl -P w -p w -m ctrl EOL chmod +x /home/pi/refresh.sh @@ -40,20 +43,10 @@ def read(id=False): # GET crontab -u root mycron rm mycron - -cat > /home/pi/.config/lxsession/LXDE-pi/autostart < /home/pi/.config/labwc/autostart < 0 and mode_data['table'][0]['is_enabled'] == 'true': screen_host = 'http://ssp:8080' - screen_path = '/plugins/mode/visitor_mode?id=visitor_mode_image' + screen_path = 'plugins/mode/visitor_mode?id=visitor_mode_image' else: screen_host = re.match("^(https?://[^/]+)/(.*)$", screen['url']).groups()[0] screen_path = re.match("^(https?://[^/]+)/(.*)$", screen['url']).groups()[1]