feat: give the classroom a desktop instead of a shell
The whole appliance UI is now configuration for a desktop Debian already ships: a Plasma 6.3 session with a colour scheme, a look and feel package that builds the bar, window rules, and KDE's own Kiosk restrictions. Two things were measured rather than assumed, and both changed a decision. Plasma restarts a crashed panel three times a minute and then gives up, which is the failure a classroom has already had. Four lines of systemd drop-in make it unconditional; the panel then survived eight SIGKILLs a second apart, back each time in 2.4s. Plasma draws a minimised task and a background task identically, so the five states the room needs cannot all be shown. Rather than write a task manager, the classroom removes minimise: clicking a launcher always means show me this. Co-Authored-By: Claude Opus 5 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5
parent
bfc7caf28f
commit
87b55761c6
+40
-6
@@ -75,8 +75,19 @@ down)
|
||||
;;
|
||||
|
||||
outer-up)
|
||||
# A headless compositor has no input devices, and a wl_seat with no
|
||||
# pointer capability never gives the session under test a pointer to
|
||||
# click with — sway's cursor commands then report success and move
|
||||
# nothing. So the lab runs wlroots' libinput backend as well, over the
|
||||
# devices the privileged container inherits, with seatd standing in for
|
||||
# the login session it does not have. Clicks in this experiment are
|
||||
# real pointer events arriving through libinput.
|
||||
docker exec "$NAME" sh -c 'pgrep -x seatd >/dev/null || \
|
||||
(SEATD_VTBOUND=0 setsid seatd -g input > /tmp/seatd.log 2>&1 &)'
|
||||
docker exec "$NAME" usermod -aG input classroom 2>/dev/null || true
|
||||
sleep 2
|
||||
session_env \
|
||||
-e WLR_BACKENDS=headless -e WLR_LIBINPUT_NO_DEVICES=1 \
|
||||
-e WLR_BACKENDS=headless,libinput -e LIBSEAT_BACKEND=seatd \
|
||||
-e WLR_RENDERER=pixman -e LIBGL_ALWAYS_SOFTWARE=1 \
|
||||
-d "$NAME" sh -c 'exec sway -c /srv/classroom/tools/lab/outer-sway.conf \
|
||||
> /tmp/outer-sway.log 2>&1'
|
||||
@@ -91,6 +102,7 @@ plasma-up)
|
||||
session_env \
|
||||
-e WAYLAND_DISPLAY="$OUTER" -e XDG_SESSION_TYPE=wayland \
|
||||
-e XDG_CURRENT_DESKTOP=KDE -e LIBGL_ALWAYS_SOFTWARE=1 \
|
||||
-e QT_LOGGING_RULES="kwin_scripting.debug=true" \
|
||||
-d "$NAME" sh -c 'exec startplasma-wayland > /tmp/plasma.log 2>&1'
|
||||
for _ in $(seq 1 60); do
|
||||
docker exec "$NAME" pgrep -x plasmashell >/dev/null 2>&1 && break
|
||||
@@ -114,27 +126,45 @@ session)
|
||||
;;
|
||||
|
||||
shot)
|
||||
# shot NAME [--delay SECONDS]
|
||||
# shot NAME [GEOMETRY] — geometry as grim wants it, e.g. "0,980 1920x100"
|
||||
name="${2:?usage: lab shot NAME}"
|
||||
outer grim /tmp/lab-shot.png >/dev/null
|
||||
if [[ -n "${3:-}" ]]; then
|
||||
outer grim -g "$3" /tmp/lab-shot.png >/dev/null
|
||||
else
|
||||
outer grim /tmp/lab-shot.png >/dev/null
|
||||
fi
|
||||
mkdir -p "$SHOTS"
|
||||
docker exec "$NAME" cat /tmp/lab-shot.png > "$SHOTS/$name.png"
|
||||
echo "$SHOTS/$name.png"
|
||||
;;
|
||||
|
||||
click)
|
||||
# click X Y — a real pointer press in the session under test
|
||||
# Absolute, through sway's own seat. This only works because the seat
|
||||
# has a pointer capability at all, which is what the uinput device in
|
||||
# `outer-up` is for.
|
||||
outer swaymsg seat - cursor set "$2" "$3" >/dev/null
|
||||
sleep 0.3
|
||||
sleep 0.4
|
||||
outer swaymsg seat - cursor press button1 >/dev/null
|
||||
sleep 0.1
|
||||
sleep 0.15
|
||||
outer swaymsg seat - cursor release button1 >/dev/null
|
||||
sleep 0.5
|
||||
;;
|
||||
|
||||
move)
|
||||
outer swaymsg seat - cursor set "$2" "$3" >/dev/null
|
||||
;;
|
||||
|
||||
drag)
|
||||
outer swaymsg seat - cursor set "$2" "$3" >/dev/null
|
||||
sleep 0.3
|
||||
outer swaymsg seat - cursor press button1 >/dev/null
|
||||
sleep 0.3
|
||||
outer swaymsg seat - cursor set "$4" "$5" >/dev/null
|
||||
sleep 0.3
|
||||
outer swaymsg seat - cursor release button1 >/dev/null
|
||||
sleep 0.4
|
||||
;;
|
||||
|
||||
key)
|
||||
shift
|
||||
outer wtype "$@"
|
||||
@@ -148,6 +178,8 @@ sh)
|
||||
run) shift; session_env "$NAME" "$@" ;;
|
||||
irun) shift; session_env -it "$NAME" "$@" ;;
|
||||
inner) shift; inner "$@" ;;
|
||||
inner-d) shift; session_env -d -e WAYLAND_DISPLAY=wayland-0 -e XDG_CURRENT_DESKTOP=KDE \
|
||||
-e QT_QPA_PLATFORM=wayland "$NAME" "$@" ;;
|
||||
inner-it) shift; session_env -it -e WAYLAND_DISPLAY=wayland-0 -e XDG_CURRENT_DESKTOP=KDE "$NAME" "$@" ;;
|
||||
outer) shift; outer "$@" ;;
|
||||
|
||||
@@ -164,9 +196,11 @@ usage: tools/lab/lab COMMAND
|
||||
plasma-down stop the Plasma session
|
||||
shot NAME capture the screen to docs/screenshots/NAME.png
|
||||
click X Y press the pointer at a screen position
|
||||
drag X1 Y1 X2 Y2 drag from one position to another
|
||||
move X Y move the pointer
|
||||
key ARGS... wtype, aimed at the session
|
||||
inner CMD... run CMD as a client of the Plasma session
|
||||
inner-d CMD... the same, detached
|
||||
outer CMD... run CMD against the lab compositor
|
||||
run CMD... run CMD as the classroom user, no display
|
||||
sh root shell in the lab
|
||||
|
||||
Reference in New Issue
Block a user