Files
Classroom_Desktop/tools/lab/install-desktop
T
ekklesiaandClaude Opus 5 30a924d945 feat: the power button does nothing, and one chord opens a terminal
Two layers for the button, because one is not enough: while a session is
running PowerDevil holds logind's handle-power-key inhibitor and acts on
the button itself, so a logind drop-in alone would be overruled. logind
covers the machine before the session starts, after it ends, and if
PowerDevil is not running. Verified: after the drop-in is installed and
logind reloaded, it reports ignore for the power, suspend, hibernate and
lid keys, and the running session was not disturbed by the reload.

Holding the button still cuts the power. That is firmware, below any
operating system, and it is deliberately left alone as the only recovery
a person standing at a wedged machine has.

The maintenance terminal is Meta+Ctrl+Alt+Shift+K, declared in the
package rather than seeded into a teacher's configuration, where an
update could not reach it. KGlobalAccel read it and registered the
component; invoking it opened a working shell.

It needed a wrapper. The classroom's Kiosk policy sets shell_access=false
and Konsole honours it — measured: with the classroom configuration in
its cascade Konsole starts and says "Program to run not set." The
restriction is worth keeping everywhere else, so it is lifted for this
one process by leaving the classroom's configuration directory out of
its cascade. It grants no privilege: the classroom user has no sudo
rule, and that restriction was always a barrier in the interface rather
than a privilege boundary.

Konsole's own entry is shadowed and hidden from /usr/local/share, so
nothing is patched and Konsole's package stays maintainable. Nothing is
pinned to the panel; a task button appears only while a terminal is
open, and closing it returns the bar to three launchers.

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-09-10 15:17:55 -05:00

79 lines
3.2 KiB
Bash
Executable File

#!/bin/bash
# Put the classroom desktop onto a machine, from the repository, at the
# paths the package will use. Run as root inside the lab.
#
# Every destination here is a normal system path that Plasma already reads.
# There is no classroom daemon in this list, and nothing is generated: the
# desktop is a set of files.
set -euo pipefail
SRC="${1:-/srv/classroom}"
# A directory of the classroom's own, ahead of /etc/xdg in
# XDG_CONFIG_DIRS. plasma-workspace owns files by these names in /etc/xdg
# and two packages cannot own one path.
for setting in kdeglobals kwinrc kwinrulesrc kscreenlockerrc ksmserverrc \
krunnerrc plasmanotifyrc powermanagementprofilesrc; do
install -Dm644 "$SRC/config/plasma/xdg/$setting" \
"/etc/ekklesia-classroom/xdg/$setting"
rm -f "/etc/xdg/$setting.ekklesia-old"
done
install -Dm644 "$SRC/config/environment/90-ekklesia-classroom.conf" \
/etc/environment.d/90-ekklesia-classroom.conf
install -Dm644 "$SRC/config/systemd/logind-ekklesia-classroom.conf" \
/etc/systemd/logind.conf.d/ekklesia-classroom.conf
install -Dm644 "$SRC/config/plasma/colors/EkklesiaDark.colors" \
/usr/share/color-schemes/EkklesiaDark.colors
install -Dm644 "$SRC/config/plasma/colors/EkklesiaLight.colors" \
/usr/share/color-schemes/EkklesiaLight.colors
LNF=/usr/share/plasma/look-and-feel/org.ekklesia.classroom.desktop
rm -rf "$LNF"
install -Dm644 "$SRC/config/plasma/lookandfeel/metadata.json" "$LNF/metadata.json"
install -Dm644 "$SRC/config/plasma/lookandfeel/contents/defaults" \
"$LNF/contents/defaults"
install -Dm644 \
"$SRC/config/plasma/lookandfeel/contents/layouts/org.kde.plasma.desktop-layout.js" \
"$LNF/contents/layouts/org.kde.plasma.desktop-layout.js"
for entry in "$SRC"/config/plasma/applications/*.desktop; do
install -Dm644 "$entry" "/usr/share/applications/$(basename "$entry")"
done
# Entries that deliberately shadow a vendor one. XDG_DATA_DIRS searches
# /usr/local/share before /usr/share, so these win without touching, and
# without being overwritten by, the package that provides the original.
for entry in "$SRC"/config/plasma/applications-local/*.desktop; do
install -Dm644 "$entry" "/usr/local/share/applications/$(basename "$entry")"
done
install -Dm644 "$SRC/config/plasma/solid/ekklesia-dvd.desktop" \
/usr/share/solid/actions/ekklesia-dvd.desktop
for icon in "$SRC"/config/icons/ekklesia-*.svg; do
[ -e "$icon" ] || continue
install -Dm644 "$icon" \
"/usr/share/icons/hicolor/scalable/apps/$(basename "$icon")"
done
install -Dm644 "$SRC/config/wallpapers/classroom-calm.png" \
/usr/share/backgrounds/ekklesia/classroom-calm.png
install -Dm644 "$SRC/systemd/user/plasma-plasmashell.service.d/ekklesia-classroom.conf" \
/etc/systemd/user/plasma-plasmashell.service.d/ekklesia-classroom.conf
for script in classroom-browser classroom-wonderink; do
[ -e "$SRC/scripts/$script" ] || continue
install -Dm755 "$SRC/scripts/$script" "/usr/local/bin/$script"
done
command -v gtk-update-icon-cache >/dev/null 2>&1 \
&& gtk-update-icon-cache -qtf /usr/share/icons/hicolor || true
command -v update-desktop-database >/dev/null 2>&1 \
&& update-desktop-database -q /usr/share/applications || true
echo "classroom desktop installed"