GithubHelp home page GithubHelp logo

rpi-kiosk's Introduction

Raspberry Pi kiosk with idle screen blanking

This repo has the basic configuration you need to turn a touchscreen-equipped Raspberry Pi into a kiosk served from a webpage. It also features screen blanking when idle / touch to wake (this is more difficult to get right than it sounds).

Tested on a Raspberry Pi 3 B+ running Raspbian Stretch.

How to use

Install needed packages:

sudo apt install --no-install-recommends \
  xserver-xorg \
  x11-xserver-utils \
  xinit \
  wmctrl \
  suckless-tools \
  openbox \
  chromium-browser

Copy the files to the home directory of the non-root user you wish to use:

cp -r rpi-kiosk/{.config,.xserverrc,sleep-timer} ~

tail -n 1 rpi-kiosk/.profile-snippet >> .profile

cp /etc/X11/xinit/xinitrc .xinitrc
tail -n 1 rpi-kiosk/.xinitrc-snippet >> .xinitrc

chmod +x ~/sleep-timer

Enable console autologin with the raspi-config tool (Boot Options > Desktop / CLI > Console Autologin). If you're setting this up from root for a user without sudo this method won't work. Instead, run the script noninteractively:

SUDO_USER=some_user raspi-config nonint do_boot_behavior B2

If you're using a new user and not the default pi, add it to the video group:

sudo usermod -a -G video some_user

How it works

The configuration in .xinitrc, .xserverrc, .profile, and autostart are all that you need for a simple kiosk. If you allow the screen to turn off when idle, however, touching it to wake triggers an unwanted click on the kiosk page. To avoid this, I disable automatic screen blanking and control it manually with the sleep-timer script. Just before turning off the screen, the script switches to a second (empty) desktop. In rc.xml I've disabled the desktop switching indicator and added a mouse bind that responds to a click event on that empty desktop by switching back to the first one.

Credits

Some resources that helped me put all this together:

rpi-kiosk's People

Contributors

thedanbob avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.