The scratchpad technically minimized Chrome, but sway hands scratchpad windows back floating, so restoring gave a draggable window instead of the maximized one the user put away. Park windows on a hidden workspace as ordinary tiled containers instead, and move them back to the visible workspace on restore. classroom-window carries the whole state machine, so the dock buttons and Super+M share one implementation: not running -> launch unfocused -> focus focused -> minimize minimized -> restore, tiled and maximized Fullscreen is dropped on the way out, since a container parked while still fullscreen keeps drawing over everything else. floating disable on the way back also rescues windows left floating by the old scratchpad path. Super+Shift+M restores the newest minimized window, so nothing can get stranded on the hidden workspace. Co-Authored-By: Claude Opus 5 <[email protected]>
40 lines
942 B
Bash
Executable File
40 lines
942 B
Bash
Executable File
#!/bin/bash
|
|
set -e
|
|
|
|
if ! id classroom >/dev/null 2>&1; then
|
|
adduser \
|
|
--disabled-password \
|
|
--gecos "" \
|
|
classroom
|
|
fi
|
|
|
|
cat > /home/classroom/.bash_profile <<'PROFILE'
|
|
if [ -z "$WAYLAND_DISPLAY" ] && [ "${XDG_VTNR:-}" = "1" ]; then
|
|
exec sway -c /etc/ekklesia-classroom/sway/config
|
|
fi
|
|
PROFILE
|
|
|
|
chown classroom:classroom /home/classroom/.bash_profile
|
|
chmod 0644 /home/classroom/.bash_profile
|
|
|
|
chmod 0755 /usr/local/bin/classroom-browser
|
|
chmod 0755 /usr/local/bin/classroom-window
|
|
|
|
if [ ! -f /etc/ekklesia-classroom/device.conf ]; then
|
|
cat > /etc/ekklesia-classroom/device.conf <<'CONFIG'
|
|
# Ekklesia Classroom device configuration
|
|
|
|
UPDATE_URL=https://updates.riverofglorymn.org
|
|
CHANNEL=stable
|
|
CONFIG
|
|
|
|
chmod 0644 /etc/ekklesia-classroom/device.conf
|
|
fi
|
|
|
|
systemctl daemon-reload || true
|
|
|
|
systemctl enable ekklesia-classroom-update.timer || true
|
|
systemctl start ekklesia-classroom-update.timer || true
|
|
|
|
exit 0
|