The room that prompted this had a television on HDMI with working PCM audio and nothing in the analog jack, and WirePlumber chose analog. A teacher who corrected it by hand then had to restart the browser before any sound came out. The policy is a pure function so it can be tested against that room rather than against a machine: an unavailable port is not a candidate, an analog port merely existing is not evidence of a cable, and an explicit AUDIO_OUTPUT overrides the lot. Twelve cases, the real room among them. The daemon follows PipeWire's own event stream rather than polling, and moves streams that are already playing, which is the part that stops a teacher having to close and reopen the browser. Co-Authored-By: Claude Opus 5 <[email protected]>
41 lines
1.4 KiB
Bash
Executable File
41 lines
1.4 KiB
Bash
Executable File
#!/bin/bash
|
|
set -euo pipefail
|
|
|
|
# Wonder Ink as an application, not a tab.
|
|
#
|
|
# Two things make it one. It runs in Chrome's app mode, so the window has
|
|
# no tab strip and no address bar and reads as a program. And it runs in
|
|
# its own Chrome profile, so the teacher signed into Wonder Ink and the
|
|
# room's shared YouTube account are separate sessions that cannot reach
|
|
# each other:
|
|
#
|
|
# * closing this window ends the Wonder Ink session, because the
|
|
# wonderink.org cookies are session-only by policy and this profile's
|
|
# browser process exits with the window;
|
|
# * a Google sign-in performed here cannot be used to re-enter the
|
|
# previous teacher's Wonder Ink account from the ordinary browser,
|
|
# because the ordinary browser's Google session is in a different
|
|
# profile;
|
|
# * and the church YouTube login in the ordinary browser survives all of
|
|
# it, because nothing here touches that profile.
|
|
#
|
|
# The machine-wide policy in /etc/opt/chrome/policies applies to every
|
|
# profile, so this window is governed by exactly the same rules as the
|
|
# browser.
|
|
|
|
HOME_PAGE='https://app.wonderink.org/'
|
|
PROFILE="${XDG_DATA_HOME:-$HOME/.local/share}/ekklesia-classroom/wonderink"
|
|
|
|
mkdir -p "$PROFILE"
|
|
|
|
exec google-chrome \
|
|
--user-data-dir="$PROFILE" \
|
|
--app="$HOME_PAGE" \
|
|
--ozone-platform=wayland \
|
|
--start-maximized \
|
|
--no-first-run \
|
|
--no-default-browser-check \
|
|
--password-store=basic \
|
|
--hide-crash-restore-bubble \
|
|
"$@"
|