Skip to content

Instantly share code, notes, and snippets.

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

Making an office dashboard with a Raspberry Pi

Start with a basic Raspbian install.

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

You can test this by running startx.

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

su - pi -c 'startx' &

References

#!/usr/bin/env zsh
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install matchbox chromium x11-xserver-utils unclutter
echo 'http://path/to/your/page' > ~/.kiosk-url
echo <<-END > ~/.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;
END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment