Kiosk mode: --kiosk CMD runs one fullscreen app, locked down, restarted when it exits
CI / test (push) Successful in 4m10s

No panel, no compositor shortcuts or desktop menus, the focused window
fullscreen (dialogs float), CMD restarted with backoff. Ctrl+Alt+Shift+Escape
or chandra-ctl kiosk lock|unlock|status for admin work. --app-id sets the X11
WM_CLASS / Wayland app id of Chandra's own window. scripts/gamerig-kiosk.sh
runs Chandra as a gamerig rig's library window on its NVIDIA Xorg.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hgvjzw8hHirxRsXSsE
This commit is contained in:
Claude committed 2026-11-26 02:22:03 +00:00
1 parent 4920f505e5
commit d521d0d840
11 files changed
+635 -16

No files matched your search

+17 -2
View File
@@ -12,6 +12,8 @@ fn main {
let mut x11 = false
let mut fullscreen = false
let mut restore = true
let mut kiosk : String? = None
let mut app_id = "chandra"
let mut width = 1280
let mut height = 720
@@ -36,6 +38,13 @@ fn main {
} else if a == "--fullscreen" {
fullscreen = true
i = i + 1
} else if a == "--kiosk" && i + 1 < args.length() {
kiosk = Some(args[i + 1]) // one fullscreen app, locked down (docs/kiosk.md)
restore = false
i = i + 2
} else if a == "--app-id" && i + 1 < args.length() {
app_id = args[i + 1] // WM_CLASS of the X11 window
i = i + 2
} else if a == "--no-restore" {
restore = false // don't reopen the apps of the last session
i = i + 1
@@ -85,7 +94,7 @@ fn main {
Some(d) => d
None => ":0"
}
match @x11.X11Window::open(display, "Chandra", "chandra", width, height, fullscreen) {
match @x11.X11Window::open(display, "Chandra", app_id, width, height, fullscreen) {
Some(x) => {
width = x.width
height = x.height
@@ -152,6 +161,10 @@ fn main {
println("chandra compositor listening on " + socket_path + " (wasi-gfx surface active)")
// chandra-ctl's socket (reload panel modules from a script); SIGUSR1 reloads too.
ignore(comp.start_control(@host.control_socket_path(@sys.getenv("XDG_RUNTIME_DIR"), socket_path)))
match kiosk {
Some(cmd) => comp.start_kiosk(cmd)
None => ()
}
if drm {
comp.login_session = true
comp.start_auth_agent() // polkit's password prompts (run0, pkexec): Chandra's dialog
@@ -235,7 +248,9 @@ fn main {
}
@sys.sleep_ms(16)
}
comp.save_session() // what is open now is reopened at the next start
if kiosk is None {
comp.save_session() // what is open now is reopened at the next start
}
match kms {
Some(k) => k.close()
None => ()