feat: an external-only display mode, chosen rather than inferred
The women's Bible study laptop is a fixed appliance: AC power, battery out, lid shut, one television on HDMI. Its own panel should be off. DISPLAY_MODE=external-only says so, and it is a setting rather than something inferred from having a lid, because another laptop may want its own screen or both. Nothing reads DEVICE_TYPE to decide it. The built-in panel is identified by kscreen's output TYPE — 7 is Panel — rather than by connector name. Matching "eDP-1" would be matching one machine's spelling: eDP, LVDS and DSI are all internal, numbered differently per driver and renamed between kernel versions. The names are kept only as a fallback for a driver that reports no type, which some virtual devices do. One rule overrides the setting: never leave the machine with no screen. A laptop asked for external-only whose television is off keeps its own panel and says so in the journal. A machine nobody can see is one nobody can fix standing in front of it, and it corrects itself the next time this runs with the set on. Only the outputs that are not already right are touched, so a television power cycle is not a stream of mode sets. Applied at login from an autostart entry named to sort before the scale one, so the scale lands on the displays this leaves enabled. The lid itself needed no new code — logind ignores every lid event, PowerDevil's lidAction is 0 in all three profiles with triggerLidActionWhenExternalMonitorPresent=false, the profiles are immutable and the classroom account cannot reach suspend through polkit. That was all already true for towers. What was missing was a test saying so, and there is one now, because it is the property the laptop depends on and nothing would have noticed it regressing. KNOWN LIMITATION, and it is written into docs/testing.md rather than left to be discovered: the mode is applied at login, not continuously. If KWin re-enables the internal panel when the television is power cycled, it stays enabled until the next login. The lab has no lid and no HDMI hotplug, so this cannot be settled here; the physical procedure says to check it specifically, because the answer decides whether the follow-up needs an event-driven applier like the audio policy's. Co-Authored-By: Claude Opus 5 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5
parent
886f8a70d2
commit
52301084a5
@@ -112,6 +112,10 @@ install -Dm755 \
|
||||
"$ROOT/scripts/classroom-scale" \
|
||||
"$STAGE/usr/local/bin/classroom-scale"
|
||||
|
||||
install -Dm755 \
|
||||
"$ROOT/scripts/classroom-display-mode" \
|
||||
"$STAGE/usr/local/bin/classroom-display-mode"
|
||||
|
||||
install -Dm755 \
|
||||
"$ROOT/scripts/classroom-shutdown" \
|
||||
"$STAGE/usr/local/bin/classroom-shutdown"
|
||||
@@ -139,6 +143,10 @@ install -Dm644 \
|
||||
"$ROOT/lib/classroom_config.py" \
|
||||
"$STAGE/usr/local/lib/ekklesia-classroom/classroom_config.py"
|
||||
|
||||
install -Dm644 \
|
||||
"$ROOT/lib/classroom_display.py" \
|
||||
"$STAGE/usr/local/lib/ekklesia-classroom/classroom_display.py"
|
||||
|
||||
|
||||
|
||||
install -Dm644 \
|
||||
@@ -427,6 +435,11 @@ install -Dm644 \
|
||||
"$ROOT/config/plasma/autostart/ekklesia-classroom-scale.desktop" \
|
||||
"$STAGE/etc/xdg/autostart/ekklesia-classroom-scale.desktop"
|
||||
|
||||
# Which displays are on, decided before the scale is applied to them.
|
||||
install -Dm644 \
|
||||
"$ROOT/config/plasma/autostart/ekklesia-classroom-display.desktop" \
|
||||
"$STAGE/etc/xdg/autostart/ekklesia-classroom-display.desktop"
|
||||
|
||||
# The panel's disc player follows this machine's hardware, and the
|
||||
# detection has to have happened before a session starts.
|
||||
install -Dm644 \
|
||||
|
||||
Reference in New Issue
Block a user