From ed5ff682efbefd3e90d21ea618473af2844b774d Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Wed, 11 Nov 2026 10:10:53 +0100 Subject: feat(sleep): tell the tablet when the PC shuts down or reboots The delay inhibitor now covers shutdown too, and dbus-monitor also watches PrepareForShutdown. X-Deckit-Sleep carries the reason ("asleep" or "shutting down") and the page shows "The PC is ", dropping the wake lock as on suspend. Co-Authored-By: Claude Opus 5.5 --- static/app.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'static') diff --git a/static/app.js b/static/app.js index c91876b..3e75a4b 100644 --- a/static/app.js +++ b/static/app.js @@ -113,7 +113,8 @@ function poll(name, seconds, update) { const tick = async () => { try { const r = await fetch(`/api/${name}`); - if (r.headers.get("X-Deckit-Sleep")) return goodnight("The PC is asleep"); + const why = r.headers.get("X-Deckit-Sleep"); + if (why) return goodnight(`The PC is ${why}`); awake(); if (r.ok) update(await r.json()); } catch { -- cgit v1.2.3