build: keep the DVD and MQTT helpers, and count the deletion honestly

Building the package showed what reading the tree did not: classroom-dvd
still calls classroom-window, classroom-mqtt still calls classroom-notify,
and the DVD overlay still imports the icon and stylesheet helpers the dock
shared. They go back in, and the write-up now counts what was actually
removed rather than what could be.

Co-Authored-By: Claude Opus 5 <[email protected]>
This commit is contained in:
ekklesia
2026-09-10 09:03:26 -05:00
co-authored by Claude Opus 5
parent 6e4786f448
commit 4c3f19d599
17 changed files with 171 additions and 1778 deletions
+23 -21
View File
@@ -11,12 +11,12 @@ set -euo pipefail
# Used by classroom-notify-test to send a sample, and by classroom-mqtt
# to put messages from the church broker on the screen.
#
# The classroom desktop runs as the classroom user, and mako is attached
# to that user's D-Bus session. An administrator over SSH sits in a
# different session where nothing owns org.freedesktop.Notifications, so
# a plain notify-send there asks D-Bus to start a second mako, which has
# no display to open and times out with NoReply. Find the running desktop
# session and deliver into it instead.
# The classroom desktop runs as the classroom user, and the notification
# service is part of that user's Plasma session. An administrator over SSH
# sits in a different session where nothing owns
# org.freedesktop.Notifications, so a plain notify-send there asks D-Bus to
# start a service that has no display to open, and times out with NoReply.
# Find the running desktop session and deliver into it instead.
CLASSROOM_USER=classroom
@@ -80,7 +80,7 @@ environ_value() {
printf '%s\n' "$1" | sed -n "s/^$2=//p" | head -n 1
}
# sway holds its own wayland-N.lock open, so the display name can be read
# The compositor holds its own wayland-N.lock open, so the display name can be read
# back off the process instead of being guessed at.
display_from_lock() {
local link target
@@ -115,17 +115,19 @@ if [[ "$current_uid" == "$classroom_uid" &&
-n "${WAYLAND_DISPLAY:-}" &&
-n "${DBUS_SESSION_BUS_ADDRESS:-}" ]]; then
# Already inside the classroom desktop session.
sway_pid="n/a"
session_pid="n/a"
runtime_dir="${XDG_RUNTIME_DIR:-}"
bus="$DBUS_SESSION_BUS_ADDRESS"
wayland_display="$WAYLAND_DISPLAY"
else
session="the $CLASSROOM_USER desktop session"
sway_pid="$(pgrep -u "$CLASSROOM_USER" -x sway | head -n 1 || true)"
# The compositor is the session: it owns the Wayland display and the
# environment every other part of the session inherited.
session_pid="$(pgrep -u "$CLASSROOM_USER" -x kwin_wayland | head -n 1 || true)"
[[ -n "$sway_pid" ]] ||
fail "no classroom desktop session is running: there is no sway process for user $CLASSROOM_USER."
[[ -n "$session_pid" ]] ||
fail "no classroom desktop session is running: there is no kwin_wayland process for user $CLASSROOM_USER."
# Checked before anything that needs to look inside the session, so
# an administrator gets told what to do rather than a permission
@@ -134,12 +136,12 @@ else
fail "run this as root (sudo classroom-notify) or as the $CLASSROOM_USER user."
fi
environment_block="$(read_environ "$sway_pid")"
environment_block="$(read_environ "$session_pid")"
if [[ -n "$environment_block" ]]; then
source_note="read from sway (pid $sway_pid)"
source_note="read from the compositor (pid $session_pid)"
else
source_note="sway's environment was unreadable; using session defaults"
source_note="the compositor's environment was unreadable; using session defaults"
fi
runtime_dir="$(environ_value "$environment_block" XDG_RUNTIME_DIR)"
@@ -164,7 +166,7 @@ else
wayland_display="$(environ_value "$environment_block" WAYLAND_DISPLAY)"
if [[ -z "$wayland_display" ]]; then
wayland_display="$(display_from_lock "$sway_pid")"
wayland_display="$(display_from_lock "$session_pid")"
fi
environment=(
@@ -186,15 +188,15 @@ else
fi
fi
# Deliver to the mako that is already running. Sending into a session
# without one would have D-Bus start a second mako, which is exactly the
# failure this script exists to avoid.
pgrep -u "$CLASSROOM_USER" -x mako >/dev/null 2>&1 ||
fail "mako is not running in the classroom session, and this will not start it. Check with: pgrep -u $CLASSROOM_USER -a mako"
# Deliver to the notification service that is already running. Sending into
# a session without one would have D-Bus start something with no display to
# draw on, which is exactly the failure this script exists to avoid.
pgrep -u "$CLASSROOM_USER" -x plasmashell >/dev/null 2>&1 ||
fail "the classroom shell is not running, and this will not start it. Check with: pgrep -u $CLASSROOM_USER -a plasmashell"
if [[ "$dry_run" == true ]]; then
echo "Would notify $session:"
echo " sway pid: $sway_pid"
echo " compositor pid: $session_pid"
echo " session environment: $source_note"
echo " XDG_RUNTIME_DIR: $runtime_dir"
echo " DBUS_SESSION_BUS_ADDRESS: $bus"