Files
ekklesiaandClaude Opus 5 d2d30d6b0c feat: take the last of sway out of the classroom
The DVD player was the only thing still speaking a compositor the room
no longer runs. It asked sway's tree whether VLC's window had really
gone fullscreen, because VLC reports playing while its window is still
the black startup one the loading cover exists to hide.

VLC's own status was measured as a replacement and is not one: it
reports fullscreen true in the same 250ms poll as playing, because the
flag is the option it was started with and not a report about its
window. So the cover is held for a floor and capped by the deadline that
was already there, and the compositor is not asked anything.

Focus-or-launch went the same way. The session already takes an
exclusive lock, so a second one cannot start, and bringing an existing
one to the front is the panel's job.

classroom-window, classroom_sway and classroom_chrome are gone with it —
the last of them was reachable from nothing at all.

DVD also moves out of the status row, where it sat beside the clock as
though a disc were a machine reading. It is an application: it is in the
row with Wonder Ink and the browser, and classroom-provision removes it
from the layout on a machine with no optical drive, which retires
DVD_ENABLED. A computer that moves between rooms takes its drive with
it; nobody remembers to edit a file when it does.

The panel is rebuilt from the package at every login now. Plasma keeps
whatever panel it first built, so an update could change the bar in the
package and never change it in a room — measured, with an icon that
outlived the file it came from. Editing the live panel configuration was
tried instead and destroyed the panel, because the shell owns that file.
Removing it before the shell starts is safe and makes the desktop
stateless.

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-09-10 13:00:50 -05:00

71 lines
2.2 KiB
Bash
Executable File

#!/bin/bash
set -uo pipefail
# Finishes setting a classroom machine up: the things that need the
# network and the apt lock, and so cannot run from the package postinst.
#
# Run from ekklesia-classroom-provision.service at every boot. Each step
# checks whether it is already done and returns immediately if so, so a
# provisioned machine costs nothing, and a machine that was offline the
# first time gets another go at the next boot.
#
# Nothing here is allowed to fail the boot. A classroom with no DVD
# codecs is still a working classroom.
log() {
echo "[classroom-provision] $1"
}
log "starting"
chrome_ok=true
if /usr/local/bin/classroom-chrome-setup; then
:
else
chrome_ok=false
log "WARNING: Google Chrome is not installed yet."
log "WARNING: Provisioning will retry automatically."
fi
# DVD codecs are only fetched for rooms that actually have a drive.
if /usr/local/bin/classroom-dvd-css-setup --if-enabled; then
:
else
log "WARNING: commercial DVD support is not set up. Unencrypted discs"
log "WARNING: still play. Retrying at the next boot, or run:"
log "WARNING: sudo classroom-dvd-css-setup"
fi
# The site printer is configured entirely through the local CUPS scheduler;
# its being powered off or unreachable does not matter. Still bound the whole
# step so a broken scheduler can never hold classroom provisioning open.
if timeout --signal=TERM --kill-after=5s 30s \
/usr/local/bin/classroom-printer-setup; then
:
else
log "WARNING: the Elmer printer queue is not configured."
log "WARNING: Provisioning will try again at the next boot, or run:"
log "WARNING: sudo classroom-printer-setup"
fi
# The bar is tailored to the machine before the session is started: a
# room with no optical drive is not offered a disc player. This writes the
# layout only; the shell rebuilds the panel from it at the next login.
if /usr/local/bin/classroom-desktop-layout; then
:
else
log "WARNING: the desktop layout was not matched to this machine."
fi
log "finished"
# Provisioning is best-effort by design.
# Chrome is required for a usable classroom. Returning failure here does
# not block boot; systemd retries this oneshot service in the background.
if [[ "$chrome_ok" != true ]]; then
exit 1
fi
exit 0