Last active
March 3, 2017 12:33
-
-
Save timgentry/053a8e1b9783f7d3fa9070b096551430 to your computer and use it in GitHub Desktop.
Kiosk Pi based on https://blogs.wcode.org/2013/09/howto-boot-your-raspberry-pi-into-a-fullscreen-browser-kiosk/
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
# Append to /etc/rc.local | |
if [ -f /boot/xinitrc ]; then | |
ln -fs /boot/xinitrc /home/pi/.xinitrc; | |
su - pi -c 'startx' & | |
fi |
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/sh | |
# /boot/xinitrc | |
while true; do | |
# Clean up previously running apps, gracefully at first then harshly | |
killall -TERM chromium-browser 2>/dev/null; | |
killall -TERM matchbox-window-manager 2>/dev/null; | |
sleep 2; | |
killall -9 chromium-browser 2>/dev/null; | |
killall -9 matchbox-window-manager 2>/dev/null; | |
# Clean out existing profile information | |
# rm -rf /home/pi/.cache; | |
# rm -rf /home/pi/.config; | |
# rm -rf /home/pi/.pki; | |
# Generate the bare minimum to keep Chromium happy! | |
# mkdir -p /home/pi/.config/chromium/Default | |
# sqlite3 /home/pi/.config/chromium/Default/Web\ Data "CREATE TABLE meta(key LONGVARCHAR NOT NULL UNIQUE PRIMARY KEY, value LONGVARCHAR); INSERT INTO meta VALUES('version','46'); CREATE TABLE keywords (foo INTEGER);"; | |
# Disable DPMS / Screen blanking | |
xset -dpms | |
xset s off | |
# Reset the framebuffer's colour-depth | |
fbset -depth $( cat /sys/module/*fb*/parameters/fbdepth ); | |
# Hide the cursor (move it to the bottom-right, comment out if you want mouse interaction) | |
# xwit -root -warp $( cat /sys/module/*fb*/parameters/fbwidth ) $( cat /sys/module/*fb*/parameters/fbheight ) | |
# Start the window manager (remove "-use_cursor no" if you actually want mouse interaction) | |
# matchbox-window-manager -use_titlebar no -use_cursor no & | |
matchbox-window-manager -use_titlebar no & | |
# Start the browser (See http://peter.sh/experiments/chromium-command-line-switches/) | |
chromium-browser --app=http://www.bbc.co.uk/ | |
done; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
First run: