Extract the Wi-Fi QR share card into its own omarchy.wifiqr panel plugin (#6598)

* Extract the Wi-Fi QR share card into its own omarchy.wifiqr panel plugin

omarchy-network-qr now leads with an iface/security/ssid meta line, so a
bare summon self-detects the connection and the plugin owns the whole
share flow. The network panel loses its overlay lifecycle: with no
centered card left inside it, the shadowed open/close collapses back to
the stock panel behavior, and the QR button just summons the plugin --
which a clone or third-party plugin can replace, like the speed test.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Keep canceled QR and password runs from leaking into their replacements

Copilot review: the cancellation guards dropped in onExited while the
canceled run's collectors were still allowed to fire, so a stale stderr
could shadow a successful regeneration and a stale password could be
revealed under a new network's card. The guards now stay up until the
next run launches, good output settles any earlier error, and a bare
re-summon no longer inherits the previous card's SSID.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
David Heinemeier Hansson
2026-08-07 12:50:04 +02:00
committed by GitHub
co-authored by Claude Fable 5
parent 474d9dd4eb
commit 018f881840
12 changed files with 519 additions and 389 deletions
+18 -2
View File
@@ -2,11 +2,21 @@
# omarchy:summary=Generate a Wi-Fi QR matrix for the shell
# omarchy:group=network
# omarchy:args=[interface]
# omarchy:args=[--meta] [interface]
set -euo pipefail
interface=${1:-}
# --meta is opt-in so pre-existing consumers of the bare matrix (cloned
# network widgets from before the share card became its own plugin) keep
# parsing this output.
interface=""
emit_meta=false
for arg in "$@"; do
case "$arg" in
--meta) emit_meta=true ;;
*) interface=$arg ;;
esac
done
if [[ -z $interface ]]; then
# Prefer the default-route device: it is the connection the panel and the
# menu's visibility gate describe. Fall back to the first connected Wi-Fi
@@ -65,6 +75,12 @@ payload="WIFI:T:$security;S:$(escape_wifi_qr "$ssid");P:$(escape_wifi_qr "$passw
[[ $hidden == "yes" ]] && payload+="H:true;"
payload+=";"
# Metadata header ahead of the matrix: the interface that was shared, the
# security type, and the SSID last so it may contain tabs. The share card
# renders its title and password row from this line, and a self-detected
# summon learns which interface to fetch the password for.
[[ $emit_meta == "true" ]] && printf 'meta\t%s\t%s\t%s\n' "$interface" "$security" "$ssid"
# ASCII uses two characters per module. Collapse each pair to one 0/1 value
# so the shell can render a square matrix directly with native QML rectangles.
# Margin 4 is the spec quiet zone; the card surround is dark, so this white