Last active
June 29, 2019 16:13
-
-
Save justsanjit/71ef80a92a5690bc8f047d596129b1c7 to your computer and use it in GitHub Desktop.
Raspberry pi kiosk with chromium
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=Chromium Kiosk | |
Wants=graphical.target | |
After=graphical.target | |
[Service] | |
Environment=DISPLAY=:0.0 | |
Environment=XAUTHORITY=/home/pi/.Xauthority | |
Type=simple | |
ExecStart=/bin/bash /home/pi/Desktop/kiosk.sh | |
Restart=on-abort | |
User=pi | |
Group=pi | |
[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 | |
# Stop the blanking out of the screen | |
xset s noblank | |
xset s off | |
xset -dpms | |
# Remove the mouse pointer when it has been | |
# idle for longer than 0.5 mins | |
# To remove the mouse instantly remove | |
# -idle 0.5 from the command | |
unclutter -idle 0.5 -root & | |
# Search chromium preferences file and | |
# clear out any flags that would make | |
# warning bar appear. | |
sed -i 's/"exited_cleanly":false/"exited_cleanly":true/' /home/pi/.config/chromium/Default/Pre$ | |
sed -i 's/"exit_type":"Crashed"/"exit_type":"Normal"/' /home/pi/.config/chromium/Default/Prefe$ | |
# If chrominum suddenly crashes or closed we | |
# do not have to use mouse or keyboard to | |
# clear the warning message | |
/usr/bin/chromium-browser --noerrdialogs --disable-infobars --kiosk https://sanjit.me & | |
# Mimic pressing Ctrl+tab every 15 seconds | |
while true; do | |
xdotool keydown ctrl+Tab; xdotool keyup ctrl+Tab; | |
sleep 15 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment