From 8a38ced0ab236a9f03839c38b3314b7b1f19f1ed Mon Sep 17 00:00:00 2001 From: Pixis <74117398+PixisVI@users.noreply.github.com> Date: Wed, 27 Mar 2024 19:26:01 +0100 Subject: [PATCH] feat: add vpn to the network service Related PR Aylur/ags#341 --- src/content/docs/services/network.md | 31 ++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/content/docs/services/network.md b/src/content/docs/services/network.md index 0f872aa..a64d8ee 100644 --- a/src/content/docs/services/network.md +++ b/src/content/docs/services/network.md @@ -13,6 +13,7 @@ This service is somewhat incomplete, feel free to open a PR to improve it * `primary`: `"wifi" | "wired"` * `wired`: `Wired` * `wifi`: `Wifi` +* `vpn`: `Vpn` ## methods @@ -58,6 +59,36 @@ meaning you can't bind to it or use notify::prop signal * `state`: `string`: [NM.DeviceState](https://gjs-docs.gnome.org/nm10~1.0/nm.devicestate) as lowercase string * `icon-name`: `string` +## Vpn + +### signals + +* `connection-added`: `(uuid: string)` +* `connection-removed`: `(uuid: string)` + +### properties + +* `connections`: `VpnConnection[]` +* `activated-connections`: `VpnConnection[]` + +### methods + +* `getConnection`: `(uuid: string) => VpnConnection` + +## VpnConnection + +### properties + +* `uuid`: `string` +* `id`: `string`: The unique name of the connection +* `state`: `"connected" | "connecting" | "disconnecting" | "disconnected"` +* `vpn-state`: `"unknown" | "prepare" | "needs_auth" | "connect" | "ip_config" | "activated" | "failed" | "disconnected"` +* `icon-name`: `string` + +### methods + +* `setConnection`: `(connect: boolean) => void` + ## Example Widget ```js