0

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
  • I'd suggest going down this route: https://serverfault.com/questions/625286/simulate-keystrokes-in-headless-environment Edit: a bit more googling and this is returned: https://stackoverflow.com/questions/38391952/cron-xdotool-doesnt-run It's the same principal though - the script works because it's using your X11, but when invoked at startup it has no terminal to output to – bob dylan Feb 28 '20 at 14:54
  • Anything in your `~/.xsession-errors`? – Thomas Mar 26 '20 at 19:21

0 Answers0