Files
Panama/config/dot/quickshell/vpn-harness.qml
T
Gabriel Brown 36fdd4e076 Give the VPN a toggle, an indicator, and a way back
Turning on a WireGuard profile whose server was unreachable used to cost the
whole network stack, and the only way out was nmcli typed into a terminal.
Quickshell's Networking module has no VPN surface, so this arrives as the one
sanctioned nmcli exception: a helper that lists, raises and lowers profiles,
a service that watches NetworkManager for changes made anywhere, a quick
settings tile (left-click toggles the most recently used profile, right-click
picks among them), and a bar glyph while a tunnel is up.

The safety property is in the helper, where it cannot be skipped: activation
waits a bounded 25 seconds, and a failure is rolled back down and reported
instead of leaving a black-hole default route. The contract pins exactly that,
against a stateful stub NetworkManager.

Claude-Session: https://claude.ai/code/session_01Epx9ZC1gwm81K3jm9x9CKh
2026-08-23 10:32:17 -04:00

31 lines
949 B
QML

import Quickshell
import Quickshell.Io
import QtQuick
import qs.services
// Drives services/Vpn.qml for tests/quickshell/vpn-contract. The contract
// stands a stub nmcli on PATH, so everything the service believes comes from
// fixtures and everything it does is recorded — no real tunnel is touched.
ShellRoot {
IpcHandler {
target: "vpn-test"
function status(): string {
return JSON.stringify({
scanned: Vpn.scanned,
available: Vpn.available,
anyActive: Vpn.anyActive,
activeSummary: Vpn.activeSummary,
busy: Vpn.busy,
lastError: Vpn.lastError,
connections: Vpn.connections
});
}
function refresh(): void { Vpn.refresh(); }
function toggle(): void { Vpn.toggle(); }
function setActive(uuid: string, on: bool): void { Vpn.setActive(uuid, on); }
}
}