#!/bin/sh # Managed by ansible (pi_kiosk role). # # Openbox is here for one concrete reason: a browser asks to be full-screen over EWMH, # and only a window manager answers that request. With no WM running, --kiosk was # silently ignored and Firefox fell back to its default 1280x972 window on a 1920x1080 # screen - the page in the top-left corner with black bands down the right edge and # along the bottom. Openbox costs a couple of MB and does nothing else here. xset s off xset -dpms xset s noblank {% if pi_kiosk_mode == 'debug' %} # Debug session. Firefox is an ordinary window with its chrome (so devtools and the URL # bar are reachable) and is *not* relaunched when it exits - quitting it should leave a # usable desktop, not fight you for the screen. Openbox is the session leader instead: # when it exits (root menu -> Exit) the X session ends and .bash_profile starts a fresh # one. Right-click the desktop for a terminal. firefox "{{ pi_kiosk_url }}" & exec openbox {% else %} openbox & unclutter -idle 0.5 -root & # The loop is what takes the place of a WM's "keep something on screen" job: Openbox # manages the window, but nothing else would bring Firefox back if it died. while true; do firefox --kiosk "{{ pi_kiosk_url }}" sleep 2 done {% endif %}