Turn a website into an application, and notice the charger
Two of Section E's small wins. panama-webapp gives a site its own icon, its own window with no browser chrome, and its own launcher entry, which is most of what "installed" means in practice and what both macOS and Windows now ship. It scrapes the site's apple-touch-icon, falls back twice, and never fails an install over a favicon: a web app with a generic icon still works. Names are slugged, so "../../../../tmp/pwn" lands inside the applications directory as tmp-pwn rather than anywhere else, and remove refuses anything without the marker it writes -- sharing a name with a real application must not delete that application. A browser that cannot do app mode is told so rather than handed something that opens an ordinary window and pretends. The charger now announces itself through StatusEvents, which was already the right layer and only wanted a producer. Ambient priority, so Do Not Disturb quiets it, because a charger is exactly what DND is for. A critically low battery is published at a priority DND does not silence, because the one message you must not miss is the one saying the machine is about to stop. Both join the existing silent-startup window rather than announcing the state they found. The keyboard-layout toast the plan also listed is deliberately not built. Hyprland exposes the active keymap but not a change event Quickshell already consumes, so it would need either polling or new event plumbing, and this machine has one layout and could not test it.
This commit is contained in:
@@ -20,4 +20,29 @@ rg -q 'id: discoverySettle' "$devices" || fail 'device discovery has no silent i
|
||||
! rg -Uq 'Component\.onCompleted:[^{\n]*\{[^}]*outputInitialized = true' "$devices" || fail 'output monitoring announces initial discovery'
|
||||
rg -Uq 'function clearFixture\(\): void \{[^}]*initialized = false' "$privacy" || fail 'leaving a fixture can emit a false privacy transition'
|
||||
|
||||
# ── The power transitions ────────────────────────────────────────────────────
|
||||
#
|
||||
# The charger is a device transition like any other, and joins the same silent
|
||||
# startup window: without it, plugging in during login would announce itself
|
||||
# while the desktop was still drawing.
|
||||
#
|
||||
# The two priorities are the actual policy. Do Not Disturb silences anything
|
||||
# below importantPriority, which is right for a charger and wrong for a battery
|
||||
# that is about to run out -- the one message you must not miss is the one
|
||||
# saying the machine is about to stop.
|
||||
rg -q 'key: "device-power"' "$devices" \
|
||||
|| fail 'nothing announces the charger being connected or removed'
|
||||
rg -q 'key: "battery-critical"' "$devices" \
|
||||
|| fail 'nothing announces a critically low battery'
|
||||
# Bounded any-character rather than "not a brace": the glyph values are
|
||||
# \u{...} escapes, so a brace appears between the key and its priority.
|
||||
rg -Uq 'key: "device-power"(.|\n){0,400}?priority: StatusEvents\.ambientPriority' "$devices" \
|
||||
|| fail 'the charger is not ambient, so Do Not Disturb would not quiet it'
|
||||
rg -Uq 'key: "battery-critical"(.|\n){0,400}?priority: StatusEvents\.criticalPriority' "$devices" \
|
||||
|| fail 'a critically low battery is silenced by Do Not Disturb'
|
||||
rg -q 'root.previousAcOnline = Battery.acOnline;' "$devices" \
|
||||
|| fail 'power monitoring does not seed its previous state in the settle window'
|
||||
! rg -Uq 'Component\.onCompleted:[^{\n]*\{[^}]*powerInitialized = true' "$devices" \
|
||||
|| fail 'power monitoring announces its initial state'
|
||||
|
||||
printf 'curated-events policy: PASS\n'
|
||||
|
||||
@@ -77,7 +77,7 @@ declare -a standalone=(
|
||||
lock-screen suspend-system log-out reboot-system power-off
|
||||
remind-me list-reminders pick-color
|
||||
switch-window force-quit-window kill-process ssh-hosts recent-files
|
||||
copy-password keyboard-shortcuts show-welcome
|
||||
copy-password keyboard-shortcuts show-welcome install-web-app
|
||||
)
|
||||
|
||||
# Generated commands must match their source. A stale command dispatches to a
|
||||
|
||||
Reference in New Issue
Block a user