aboutsummaryrefslogtreecommitdiffstats
path: root/deckit/server.py
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-11-11 10:10:53 +0100
committerDanilo M. <danix@danix.xyz>2026-11-11 10:10:53 +0100
commited5ff682efbefd3e90d21ea618473af2844b774d (patch)
tree9a25fca9e3aac26792c8eee40f33bf6b843d9cdb /deckit/server.py
parent6a9a1ae47e758afb9a747a619b5665cb5908834a (diff)
downloaddeck-it-ed5ff682efbefd3e90d21ea618473af2844b774d.tar.gz
deck-it-ed5ff682efbefd3e90d21ea618473af2844b774d.zip
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 <reason>", dropping the wake lock as on suspend. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'deckit/server.py')
-rw-r--r--deckit/server.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/deckit/server.py b/deckit/server.py
index 9246e54..f222ecb 100644
--- a/deckit/server.py
+++ b/deckit/server.py
@@ -171,8 +171,8 @@ class Handler(BaseHTTPRequestHandler):
self.send_header("Content-Type", ctype)
self.send_header("Content-Length", str(len(body)))
self.send_header("Cache-Control", "max-age=86400" if cache else "no-store")
- if sleep.sleeping.is_set():
- self.send_header("X-Deckit-Sleep", "1") # the tablet shows "asleep" at once
+ if sleep.why:
+ self.send_header("X-Deckit-Sleep", sleep.why) # the tablet shows it at once
self.end_headers()
self.wfile.write(body)