summaryrefslogtreecommitdiff
path: root/.config/polybar/mullvad_status.sh
blob: fbca326c53221526d0e0b3c90fcd260a9dfe9c5e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'

MULLVAD_STATUS=$(mullvad status)

if echo $MULLVAD_STATUS | grep -q 'Connected'; then
  echo "%{u#75d85a}VPN %{T5}✅%{T-}"
 elif echo $MULLVAD_STATUS | grep -q 'Connecting'; then
   echo "VPN ..."
 else
  echo "%{u#f90000}VPN %{T5}🚫%{T-}"
fi