Last active
December 2, 2024 05:40
-
-
Save brettinternet/6714fba9e831f5d7c463bb92b131132f to your computer and use it in GitHub Desktop.
Kiosk mode for raspberry pi device
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Kiosk | |
Wants=graphical.target | |
After=graphical.target | |
[Service] | |
Environment="DISPLAY=:0" | |
Type=simple | |
ExecStart=/bin/bash $HOME/kiosk.sh | |
Restart=on-abort | |
User=brett | |
Group=brett | |
[Install] | |
WantedBy=graphical.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cleanup() { | |
pkill -P $$ | |
} | |
trap cleanup EXIT | |
xset s noblank | |
xset s off | |
xset -dpms | |
unclutter -idle 0.5 -root & | |
sed -i 's/"exited_cleanly":false/"exited_cleanly":true/' /home/$USER/.config/chromium/Default/Preferences | |
sed -i 's/"exit_type":"Crashed"/"exit_type":"Normal"/' /home/$USER/.config/chromium/Default/Preferences | |
/usr/bin/chromium-browser --noerrdialogs --disable-infobars --kiosk https://example.com & | |
# switch between tabs | |
while true; do | |
xdotool keydown ctrl+Next; xdotool keyup ctrl+Next; | |
sleep 15 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment