MagnuC
Posts: 2
Joined: Sat Sep 16, 2023 3:09 pm

trying to make a script that opens a website in kiosk mode

Sat Sep 16, 2023 3:26 pm

Hello.

I'm trying to make a script that opens a website in kiosk mode and do keystrokes using xdotool on my rasbperry pi 4.

I get the script to open the webpage, make some keystrokes, but then it "crashes" or, it closes.
If i delete all the keystroke commands it does not crash, it stays on the webpage, nut i want to make those keystrokes.
the scipt looks like this :
--------------------------------------------
#!/bin/bash
xset s noblank
xset s off
xset -dpms

sed -i 's/"exited_cleanly":false/"exited_cleanly":true/' /home/pi/.config/chromium/Default/Preferences
sed -i 's/"exit_type":"Crashed"/"exit_type":"Normal"/' /home/pi/.config/chromium/Default/Preferences

/usr/bin/chromium-browser --noerrdialogs --disable-infobars --kiosk http://weppage.com/&

sleep 15

tabcnt=7
xdotool key --repeat $tabcnt --delay 200 Tab

sleep 3

xdotool key Return

sleep 3
---------------------------------------

i just want to to stop and stay on the webpage that appears after those keystrokes.

Can anyone help me in this matter.
Thanks.

klricks
Posts: 8816
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA

Re: trying to make a script that opens a website in kiosk mode

Sun Sep 17, 2023 2:21 am

Your script works for me using https://bbc.com
(RPi4B4G RPiOS 64b)
Unless specified otherwise my response is based on the latest and fully updated RPi OS Bullseye w/ Desktop OS.

MagnuC
Posts: 2
Joined: Sat Sep 16, 2023 3:09 pm

Re: trying to make a script that opens a website in kiosk mode

Sun Sep 17, 2023 5:41 pm

wierd, the window closes for me, but if i leave out the keystrokes the window stays.
I cant figure out why.

Return to “General programming discussion”