Skip to content

Instantly share code, notes, and snippets.

@davidkelley
Last active December 22, 2015 03:49
Show Gist options
  • Save davidkelley/6413296 to your computer and use it in GitHub Desktop.
Save davidkelley/6413296 to your computer and use it in GitHub Desktop.
This Gist will setup a full-screen Chromium kiosk on the Raspberry Pi without launching any GUI. It will clone a repository from the provided location and navigate to it inside Chromium.
#location of git repo
REPO=""
#install library dependencies
sudo apt-get update && apt-get upgrade -y
sudo apt-get install -y chromium-browser x11-xserver-utils unclutter xwininfo git git-core couchdb
#better font experience
sudo apt-get install -y ttf-mscorefonts-installer
#clone repo to destination
git clone $REPO ~/dist
#setup couchdb - bind to port and address: 127.0.0.1:5984
sudo vi -c "11,12s/^;//" -c "wq" /etc/couchdb/local.ini
#now restart couchdb
/etc/init.d/couchdb restart
#create X11 window manager configuration file
cat << 'EOF' > ~/.xinitrc
#!/bin/sh
WIDTH=`xwininfo -root|grep Width | awk '{ print $2}'`
HEIGHT=`xwininfo -root|grep Height | awk '{ print $2}'`
xset s off &
xset s noblank &
xset -dpms &
xscreensaver -no-splash &
xsetroot -solid white &
unclutter &
exec chromium-browser --window-size=$WIDTH,$HEIGHT --incognito --disable-web-security --allow-files-access-from-files --kiosk ~/dist
EOF
#run chromium when rpi starts
sudo echo "su pi -c startx" > /etc/rc.local
#setup auto-login
sudo vi -c '54s/^.*$/"1:2345:respawn:\/bin\/login -f pi tty1 <\/dev\/tty1 >\/dev\/tty1 2>&1"/' -c 'wq' /etc/inittab
@davidkelley
Copy link
Author

Before running this script, enter the location of the Git repo that you wish to clone into the $REPO variable and ensure that you have permission to clone the repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment