Add kiosk

This commit is contained in:
Audiobuzz
2026-06-16 20:38:26 +00:00
parent d331ff5589
commit 61088d4e6d
5 changed files with 138 additions and 1 deletions
+22
View File
@@ -0,0 +1,22 @@
#!/bin/bash
# kiosk-session — launched by cage (Wayland) from kiosk.service.
# Starts Chromium fullscreen on the configured URL.
#
# KIOSK_URL comes from /etc/kiosk/kiosk.env (baked from the kiosk_url Packer
# var; a runtime config-agent could override it later). The Chromium profile is
# pinned to a tmpfs path so writes land in RAM (the root is read-only erofs +
# volatile overlay) — watch RAM if the page is heavy.
#
# VM/GPU notes: --disable-gpu + the pixman wlroots renderer (WLR_RENDERER in
# kiosk.env) keep this working on VMs with no real GPU. On hardware with a GPU,
# drop --disable-gpu (and set WLR_RENDERER=gles2) for compositing.
set -euo pipefail
BROWSER=$(command -v chromium-browser || command -v chromium)
exec "$BROWSER" \
--kiosk --noerrdialogs --disable-infobars --incognito --no-first-run \
--disable-session-crashed-bubble --start-maximized \
--ozone-platform=wayland --disable-gpu \
--user-data-dir=/tmp/kiosk-profile --disk-cache-dir=/tmp/kiosk-cache \
"${KIOSK_URL:?KIOSK_URL not set in /etc/kiosk/kiosk.env}"
+33
View File
@@ -0,0 +1,33 @@
[Unit]
Description=Wayland kiosk (cage + Chromium)
Documentation=https://github.com/cage-kiosk/cage
# Take over tty1 from the login getty and start after the network is up (the
# kiosk loads a URL). plymouth-quit lets the splash hand off cleanly.
After=systemd-user-sessions.service plymouth-quit-wait.service getty@tty1.service network-online.target
Wants=network-online.target
Conflicts=getty@tty1.service
[Service]
Type=simple
User=kiosk
# A real PAM login session on tty1 so logind assigns seat0 — cage/wlroots needs
# a seat for DRM master + libinput. (PAMName runs account/session, not auth, so
# the passwordless kiosk user is fine.)
PAMName=login
TTYPath=/dev/tty1
TTYReset=yes
TTYVHangup=yes
TTYVTDisallocate=yes
StandardInput=tty-fail
StandardOutput=journal
StandardError=journal
UtmpIdentifier=tty1
UtmpMode=user
EnvironmentFile=/etc/kiosk/kiosk.env
# cage -s: single-client kiosk compositor; runs the wrapper, exits when it does.
ExecStart=/usr/bin/cage -s -- /usr/local/bin/kiosk-session
Restart=always
RestartSec=2
[Install]
WantedBy=graphical.target