I made a linux script for Raspberry Pi, which opens chromium and logs into a website using xdotool + Auto Login extension. When I execute the script manually from a terminal everything works, but if the script is called from autostart file (after reboot) the xdotool is not working. I can see that the "Tab" key and "Return" are not hit. Everything else inside the script is working.
What could be the problem?
Something with user rights?
Window is not active?
Here's the script:
#!/bin/bash
#exec>/home/pi/Documents/logfile 2>&1
chromium-browser --noerrdialogs --disable-infobars --disable-session-crashed-bubble --disable-session-restore-state --kiosk /home/pi/Downloads/xxx.html &
sleep 10
xdotool keydown Tab
sleep 0.5
xdotool keyup Tab
sleep 2
xdotool keydown Return
sleep 0.5
xdotool keyup Return
sleep 20
chromium-browser --kiosk /home/pi/Downloads/yyy.html &
And this is the autostart file:
@lxpanel --profile LXDE-pi
@pcmanfm --desktop --profile LXDE-pi
#Comment out the screensaver line
# @xscreensaver -no-splash
#Disable screensaver by adding following
@xset s noblank
@xset s off
@xset -dpms
#Turn off mouse cursor after 5 seconds of no action
@unclutter -idle 5
point-rpi
@/home/pi/Documents/test2.sh