Skip to content

Instantly share code, notes, and snippets.

@Aupajo
Last active August 29, 2015 14:01
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Aupajo/add590ac7eab6046a8d4 to your computer and use it in GitHub Desktop.
Save Aupajo/add590ac7eab6046a8d4 to your computer and use it in GitHub Desktop.

Making an office dashboard with a Raspberry Pi

Steps taken with a basic Raspbian install.

Default username/password is pi/raspberry.

SSH access is enabled by default; run ifconfig on the Pi to find the IP address to connect to.

Bring everything up-to-date:

sudo apt-get update
sudo apt-get upgrade

Install the following packages:

sudo apt-get install matchbox chromium x11-xserver-utils unclutter

Rationale:

  • chromium – a browser, that will be run in a full-screen “kiosk” mode
  • matchbox – a lightweight, single-window X environment for the browser to run in (starting a full desktop environment would be wasteful)
  • x11-xserver-utils – tools to allow configuring the X environment to, for instance, prevent the screen from blanking after several minutes
  • unclutter – hide the mouse

X set-up

Inside /home/pi/.kiosk-url:

http://path/to/your/page

Inside /home/pi/.xinitrc:

#!/bin/sh

# Disable power dimming and screensaver
xset -dpms
xset s off

while true; do

  # Clean up previously running apps, gracefully at first then harshly
  killall -TERM chromium 2>/dev/null;
  killall -TERM matchbox-window-manager 2>/dev/null;

  sleep 2;

  killall -9 chromium 2>/dev/null;
  killall -9 matchbox-window-manager 2>/dev/null;
 
  # Hide cursor
  unclutter &

  # Launch window manager without title bar
  exec matchbox-window-manager -use_titlebar no &

  # Launch browser
  chromium --incognito --kiosk `cat /home/pi/.kiosk-url`
done;

You can test this by running startx on the Pi (not over SSH).

To boot into this mode, add the following to /etc/rc.local (before exit 0):

su - pi -c 'startx' &

References

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