Tag Archives: raspberry

Raspberry Pi kiosk-ish system

I needed to build kiosk-ish system for our reception to display pending tasks etc. I was stumbleing around of bunch of useless tutorials, which are either right and wrong at the same time. I found this one and it is tested on raspbian, work like a charm.

As much as you don’t want to use graphic display manager on your raspbery, you will have to 🙁

We’ll need the following packages:

matchbox
chromium
x11-xserver-utils
ttf-mscorefonts-installer
xwit
sqlite3
libnss3

sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get install matchbox chromium x11-xserver-utils ttf-mscorefonts-installer xwit sqlite3 libnss3

If you raspberry does not dettect automaticaly it’s resolution on boot, you can edit /boot/config.txt and add following parametters:

# 1900×1200 at 32bit depth, DMT mode
disable_overscan=1
framebuffer_width=1900
framebuffer_height=1200
framebuffer_depth=32
framebuffer_ignore_alpha=1
hdmi_pixel_encoding=1
hdmi_group=2

Starting Chromium:

Add at the end of youre /etc/rc.local

if [ -f /boot/xinitrc ]; then
ln -fs /boot/xinitrc /home/pi/.xinitrc;
su – pi -c ‘startx’ &
fi

… and create /boot/xinitrc file with:

#!/bin/sh

# 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;

# 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 &

# Start the browser (See http://peter.sh/experiments/chromium-command-line-switches/)
chromium –app=http://URL.of.your/choice.html

Save it, reboot and that’s it.