Skip to content

Instantly share code, notes, and snippets.

@bastijns-jeroen
Last active November 11, 2021 05:48
Show Gist options
  • Select an option

  • Save bastijns-jeroen/4525dd066b75fe7e246c4d62da98f5bd to your computer and use it in GitHub Desktop.

Select an option

Save bastijns-jeroen/4525dd066b75fe7e246c4d62da98f5bd to your computer and use it in GitHub Desktop.
Raspberry pi kiosk mode

#This is a setup for using your raspberry pi as a kiosk.

  • Install raspbian to use it as a full fledged desktop (with X so not only the terminal)

##To avoid the screen from turning itself off after 10 minutes of inactivity Install x11-xserver-utils

apt-get install x11-xserver-utils 

Now open up your ~/.xinitrc file (if you don't have one then create it) and enter this:

xset s off         # don't activate screensaver 
xset -dpms         # disable DPMS (Energy Star) features. 
xset s noblank     # don't blank the video device

Start lxde

exec /etc/alternatives/x-session-manager      # start lxde

Edit /etc/lightdm/lightdm.conf and use the following xserver-command:

[SeatDefaults]
xserver-command=X -s 0 -dpms

##Don't display the cursor when you do not move it

Install unclutter

sudo apt-get install unclutter

Run it

unclutter -idle 0.01 -root

the number is a number of seconds before the pointer disappears (in this case, 1/100 seconds)

Send signal to hdmi port to turn the tv on and off

Install cec-client to send a signal to the tv through hdmi.

sudo apt-get install cec-utils

Edit the crontab for the root user

sudo crontab -u root -e

Add the following line

# Enable the monitor every weekday morning at 7:00
00 7 * * 1,2,3,4,5 echo "on 0" | cec-client -s
# Change the source to Raspi HDMI at 7:01 
01 7 * * 1,2,3,4,5 echo "as" | cec-client -s

# Put the monitor in standby every weekday morning at 8:15
15 8 * * 1,2,3,4,5 echo "standby 0" | cec-client -s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment