1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-11 07:52:50 -05:00

VPN profiles: include vpn.service-type for TYPE=vpn; show friendly protocol label in popout (OpenVPN, WireGuard, IPsec, etc.); fix active icon to support multi-active

This commit is contained in:
Jon Rogers
2025-08-31 16:33:07 -04:00
parent 585ceb96e4
commit d91c3572af
2 changed files with 31 additions and 12 deletions

View File

@@ -72,7 +72,7 @@ Singleton {
Process {
id: getProfiles
command: ["nmcli", "-t", "-f", "NAME,UUID,TYPE", "connection", "show"]
command: ["bash", "-lc", "nmcli -t -f NAME,UUID,TYPE connection show | while IFS=: read -r name uuid type; do case \"$type\" in vpn) svc=$(nmcli -g vpn.service-type connection show uuid \"$uuid\" 2>/dev/null); echo \"$name:$uuid:$type:$svc\" ;; wireguard) echo \"$name:$uuid:$type:\" ;; *) : ;; esac; done"]
running: false
stdout: StdioCollector {
onStreamFinished: {
@@ -81,7 +81,8 @@ Singleton {
for (const line of lines) {
const parts = line.split(':')
if (parts.length >= 3 && (parts[2] === "vpn" || parts[2] === "wireguard")) {
out.push({ name: parts[0], uuid: parts[1], type: parts[2] })
const svc = parts.length >= 4 ? parts[3] : ""
out.push({ name: parts[0], uuid: parts[1], type: parts[2], serviceType: svc })
}
}
root.profiles = out