Checks if you are connected via Mullvad VPN.
#!/bin/zsh
# <xbar.title>Mullvad VPN Status</xbar.title>
# <xbar.version>v0.1.0</xbar.version>
# <xbar.author>Nils Stein</xbar.author>
# <xbar.author.github>n-stone</xbar.author.github>
# <xbar.desc>Checks if you are connected via Mullvad VPN.</xbar.desc>
# <xbar.image>https://imgur.com/a0uvsfX.png</xbar.image>
# <xbar.dependencies>"font awesome 5 free" (https://use.fontawesome.com/releases/v5.15.4/fontawesome-free-5.15.4-desktop.zip),jq</xbar.dependencies>
# Make sure homebrew is on the path
export PATH="/opt/homebrew/bin:$PATH"
# Mullvad Icon as Base64
MULLVAD_ICON="iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAMqXpUWHRSYXcgcHJvZmlsZSB0eXBlIGV4aWYAAHjarVpZluM6rvzHKnoJ4kwuR5zO6R285XcApCTKKbucVS99K+WUaBBABDH5Uvu//3b6D36c15GsC9En7zf82GST3vEmbuNnl99qs/Jbfux8hL9v9+l8oHHL4GrGn9HP9cd9dQoYlx3v3CIolvkg3x+kuYOOL4L0uBjWiN/XKShNQUaPB2oK2IdZm08xrCbkNq71sCSOf8S/+n5X+/VvG+C96rCP0boZZTb81iYOBQz/U2R2PND4vZmAhcoYvDdyR5swhcEhT346fxI06m1C8XPRDZXznXq+T69oWT2XmBcn+/P6eJ+Ue3lgzn30jT9xvtP3+3sd8ND24n1xfq+xi82wYrcervbTqMMUeYd1GVvw1pGgmt8C/jmICPJKeEWwumCvupUt41VUUhpwdWVVVbvqqsm1qAIVrW6kgZXWugBBvhmBXdLFMH6WX6rrYJKpJgLFAtgN7upTFyXbpq2Q7Baxc1VYqhWEMR1+/aLffqB3PgpKbfH0FfTSmp0NNRg5/o1lwED16VQnDj5erz+MqwGCjr3MRyTBsXmIyE5dkcAI0AYLHa7jDKpQpwC4CFs7KKMMEABqyjjl1Ra0DkrBkREA7VBdG6szEFDO6QoltTXGA5uoeWt8JChZqp3GbcJ9BDMg4Yw3AdgkswM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IjEiCiAgIHhtcDpDcmVhdG9yVG9vbD0iR0lNUCAyLjEwIj4KICAgPHhtcE1NOkhpc3Rvcnk+CiAgICA8cmRmOlNlcT4KICAgICA8cmRmOmxpCiAgICAgIHN0RXZ0OmFjdGlvbj0ic2F2ZWQiCiAgICAgIHN0RXZ0OmNoYW5nZWQ9Ii8iCiAgICAgIHN0RXZ0Omluc3RhbmNlSUQ9InhtcC5paWQ6ODZiMWVmNDQtNjRlMS00ZWVlLThhM2UtNDZhMzVhNzIyMDg5IgogICAgICBzdEV2dDpzb2Z0d2FyZUFnZW50PSJHaW1wIDIuMTAgKE1hYyBPUykiCiAgICAgIHN0RXZ0OndoZW49IjIwMjEtMTItMDdUMTM6MzI6MjcrMDE6MDAiLz4KICAgIDwvcmRmOlNlcT4KICAgPC94bXBNTTpIaXN0b3J5PgogIDwvcmRmOkRlc2NyaXB0aW9uPgogPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgIAo8P3hwYWNrZXQgZW5kPSJ3Ij8+hjOjiAAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAAmcwAAJnMB82x1CgAAAAd0SU1FB+UMBwwgG8SB4QMAAAaiSURBVHja5ZttbJ5lFcd/V7uNlXZzg7mOFMIUxqZTw7I46qbBaHxZFo0lGHyJHyQRlxhiOqMgwRAjaTDq4gddJOrAELVoNBBxwkZ8iaBkhGim2YIC4qRzbJQAG1TXtT8+9BQfn/Vp77fnaUnPp77c97nOOfd1nZf/OVeihaQmYAGwCOgClsa/XgBOAqeA0yklWyVTarLCi4FLgc3ABuCNQA9wLtBW9/g4MAwMAQeBPwF/AP6cUvoPrxZSO9Q+dVB9Rh23OI0Hj8Hg2TGXFe9RB9QjNo+OxBo9c0nxlepO9aSto5Ox5srZVHyBul097uzR8ZBhQauVX63uc+7QPnV1q5Tfph5z7tExdVtTY7jar55y7tKpkDFVmgeobcDNwHVTxO8qaAR4FHgCOA10ABcBrwcW5+Q1DnwVuDGlNF7Vlx8o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vpcs5a4MngWcrWHYYONUWtf9QAQZdwN3qJ0oCmxcDPw7Hl6UNdgDYX4EBhkJ3CLi6KJ1Wb8lb3MQozfXRHrsyEKOODO/1qFfUJW9F6I6ZiqG89Hv1kozx/sPqIfWf6uUFAJA9Fci7Y7pyuCgdUs9Xl00BX6+PnP9gIDhfK5JdRg1wifqvksNXva9ggnH2nmJifK3wcQa2xPncBLwbeHNgjN2x1gFgD3B3Smm4hMP8GdBX0gGe/3/jdzWQWBm6ocFZP7tiFGhtyWm0wamY9lXUA2x6phg1QpmudV8jr1zFjN/uFhigXf1NiVnDjjNaY4GTlwU/xoAfNNsAKaUx4NYGbbiZ6PYzegJ1MbbMwOMPqzzrM+yC/oIDlj0zMd5ZUPm/qefSIlLPivZ6HtqZhXGR9vgRdd0sFEar1L+UaY83YpxnQOKEehmzROqFgRdUMyARTPOMyNzCLJP6lUpHZIJp1iGpQ1X1Egsq3xv4RHVDUjXMs47J7c8681ex8u8IzLD6Mbm6cDOWMQpsbJHibeqnA55r3qBkTfWVdVT2ZDQrFzdR+bUxczjeklHZGosP5MDiDqofVc+qUPF16ndqulbTffmBovOHM+2EvOPy/wgkd0ORdrh6gXq1en/GdZszLl/vGIHbgNfmxAqGAis4APw9fj/BxH3BLiZG5FcxMSK/HngrcDETdwyz0HHgkymlX7bCCc3fKzN1ydL8vDQ1Re0w/67NNSil59/FyQbI0qvm6uy8vzydWrw75tz1+ZcB4+KjbJD6Cc4AAAAASUVORK5CYII="
SECURE=" "
NOT_SECURE=" "
NO_CONNECTION=" "
if ping -q -W 1 -c 1 1.1.1.1 > /dev/null; then
MULLVAD_JSON=$(curl -s https://am.i.mullvad.net/json)
if [ $(echo $MULLVAD_JSON | jq -r .'mullvad_exit_ip') = 'true' ]; then
echo "$SECURE | font='FontAwesome5Free-Solid' | size=16 | trim=false | templateImage=$MULLVAD_ICON"
echo "---"
echo "Hostname: $(echo $MULLVAD_JSON | jq -r .'mullvad_exit_ip_hostname')"
echo "IP: $(echo $MULLVAD_JSON | jq -r .'ip')"
echo "Country: $(echo $MULLVAD_JSON | jq -r .'country')"
echo "City: $(echo $MULLVAD_JSON | jq -r .'city')"
echo "Type: $(echo $MULLVAD_JSON | jq -r .'mullvad_server_type')"
echo "Organization: $(echo $MULLVAD_JSON | jq -r .'organization')"
echo "---"
echo "Refresh now (normally every 5m) | refresh=true"
else
echo "$NOT_SECURE | font='FontAwesome5Free-Solid' | size=16 | trim=false | templateImage=$MULLVAD_ICON"
echo "---"
echo "disconnected"
echo "---"
echo "Refresh now (normally every 5m) | refresh=true"
fi
else
echo "$NO_CONNECTION | font='FontAwesome5Free-Solid' | size=16 | trim=false | templateImage=$MULLVAD_ICON"
echo "---"
echo "offline"
echo "---"
echo "Refresh now (normally every 5m) | refresh=true"
fi
exit 0