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]>
This commit is contained in:
ekklesia
2026-09-10 15:17:55 -05:00
co-authored by Claude Opus 5
parent 699858a71e
commit 30a924d945
13 changed files with 204 additions and 3 deletions
@@ -0,0 +1,20 @@
[Desktop Entry]
# Konsole, hidden.
#
# Shadows the entry Konsole's own package installs, from
# /usr/local/share/applications, which XDG_DATA_DIRS searches first. The
# real entry is left exactly where Konsole put it, so the package stays
# maintainable and an upgrade does not fight this.
#
# The terminal is still reachable, by one chord, through
# ekklesia-admin-terminal.desktop. It is simply not something a teacher
# can come across.
Type=Application
Name=Konsole
Comment=Terminal
Exec=/usr/bin/konsole
Icon=utilities-terminal
Terminal=false
Categories=System;TerminalEmulator;
NoDisplay=true
StartupWMClass=org.kde.konsole
@@ -0,0 +1,18 @@
[Desktop Entry]
Type=Application
Name=Ekklesia maintenance terminal
Comment=For the technical administrator, standing at the machine
Exec=/usr/local/bin/classroom-admin-terminal
Icon=utilities-terminal
Terminal=false
Categories=System;
StartupNotify=true
StartupWMClass=org.kde.konsole
# The chord is deliberately awkward. KGlobalAccel reads this key from the
# entry itself, so the shortcut ships in the package rather than having to
# be seeded into a teacher's configuration where an update could not
# reach it.
X-KDE-Shortcuts=Meta+Ctrl+Alt+Shift+K
# Not in any application list. There is no menu in this classroom anyway;
# this says so out loud.
NoDisplay=true
@@ -0,0 +1,26 @@
# The desktop half of "the power button does nothing".
#
# PowerDevil takes logind's handle-power-key inhibitor while a session is
# running, so the logind drop-in on its own would be overruled by
# whatever this says. 0 is no action.
#
# Immutable, so nothing in the session can put an action back.
#
# Every profile gets the same answer. A classroom machine has no battery,
# but a profile that exists and disagrees is worse than one that does not
# exist at all.
[AC][HandleButtonEvents][$i]
powerButtonAction=0
lidAction=0
triggerLidActionWhenExternalMonitorPresent=false
[Battery][HandleButtonEvents][$i]
powerButtonAction=0
lidAction=0
triggerLidActionWhenExternalMonitorPresent=false
[LowBattery][HandleButtonEvents][$i]
powerButtonAction=0
lidAction=0
triggerLidActionWhenExternalMonitorPresent=false