diff options
| author | Rubén Beltrán del Río <jj@r.bdr.sh> | 2026-07-14 15:02:51 +0200 |
|---|---|---|
| committer | Rubén Beltrán del Río <jj@r.bdr.sh> | 2026-09-02 23:39:29 +0200 |
| commit | 51b27719a444764872f018a56e36ff406e892b27 (patch) | |
| tree | 426846f83d310c5d6389feeb069d30870509c54a /config/waybar/scripts/mullvad.sh | |
| parent | 34cc3551b4138cdb96e071c7c1fdd36b7d85d1cb (diff) | |
Update waybar config
Diffstat (limited to 'config/waybar/scripts/mullvad.sh')
| -rwxr-xr-x | config/waybar/scripts/mullvad.sh | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/config/waybar/scripts/mullvad.sh b/config/waybar/scripts/mullvad.sh deleted file mode 100755 index e02bb2f..0000000 --- a/config/waybar/scripts/mullvad.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env bash - -STATUS_KEY="state" -RUNNING="connected" - -mullvad_status () { - status="$(mullvad status --json | jq -r '.'$STATUS_KEY)" - if [ "$status" = $RUNNING ]; then - return 0 - fi - return 1 -} - -toggle_status () { - if mullvad_status; then - mullvad disconnect - else - mullvad connect - fi -} - -case $1 in - --status) - if mullvad_status; then - status_json=$(mullvad status --json) - endpoint=$(echo "$status_json" | jq -r '.details.endpoint | "\(.tunnel_interface) (\(.tunnel_type))"') - location=$(echo "$status_json" | jq -r '.details.location | "\(.country), \(.city) (\(.ipv4))"') - echo "{\"text\":\"\",\"class\":\"connected\",\"alt\":\"connected\", \"tooltip\": \"${endpoint}\\n${location}\"}" - else - echo "{\"text\":\"\",\"class\":\"disconnected\",\"alt\":\"disconnected\", \"tooltip\": \"VPN is not active.\"}" - fi - ;; - --toggle) - toggle_status - ;; -esac - |