Change text in mullvad waybar component
This commit is contained in:
@ -2,8 +2,8 @@
|
||||
|
||||
if ! which mullvad &> /dev/null
|
||||
then
|
||||
echo "ERROR: command 'mullvad' does not exist"
|
||||
exit 1
|
||||
echo "ERROR: command 'mullvad' does not exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
STATUS="$(mullvad status)"
|
||||
@ -13,26 +13,24 @@ CONNECTED="Tunnel status: Connected"
|
||||
DISCONNECTED="Tunnel status: Disconnected"
|
||||
|
||||
check_status() {
|
||||
STRING="$1"
|
||||
echo "$STATUS" | grep -iq "$STRING"
|
||||
STRING="$1"
|
||||
echo "$STATUS" | grep -iq "$STRING"
|
||||
}
|
||||
|
||||
TOOLTIP="$STATUS"
|
||||
|
||||
TEXT="VPN"
|
||||
|
||||
if check_status "$CONNECTED"; then
|
||||
TEXT="Connected"
|
||||
ON_CLICK="mullvad disconnect"
|
||||
CLASS=""
|
||||
elif check_status "$DISCONNECTED"; then
|
||||
TEXT="Disconnected"
|
||||
ON_CLICK="mullvad connect"
|
||||
CLASS="disconnected"
|
||||
elif check_status "$CONNECTING"; then
|
||||
TEXT="Connecting..."
|
||||
ON_CLICK="mullvad disconnect"
|
||||
CLASS="connecting"
|
||||
else
|
||||
TEXT="Error"
|
||||
ON_CLICK="mullvad reconnect"
|
||||
CLASS="disconnected"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user