The role ran no window manager on the theory that Firefox is the only X client and --kiosk makes it full-screen by itself. It doesn't: --kiosk *asks* to be full-screen over EWMH, and with no WM running nobody answers. Firefox kept its default window size in the top-left corner - on musicdolphin's 1920x1080 monitor, a 1280x972 window with black bands down the right edge and along the bottom, which looks exactly like an overscan problem and isn't one. Openbox answers the request and does nothing else. pi_kiosk_mode=debug then turns the attached screen into something workable: Firefox as an ordinary window that is not relaunched when you close it, a visible pointer, Openbox as the session leader with a root menu offering a terminal, and xterm, x11-utils and mesa-utils installed. musicdolphin is set to debug for now. The templates notify the getty handler, so a mode switch restarts the session on its own - Xorg lives in that unit's cgroup. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
35 lines
1.2 KiB
Django/Jinja
35 lines
1.2 KiB
Django/Jinja
#!/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 %}
|