vpn button waybar
This commit is contained in:
12
.config/waybar/scripts/wireguard-status.sh
Executable file
12
.config/waybar/scripts/wireguard-status.sh
Executable file
@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
|
||||
SERVICE_NAME="wg-quick@wg0"
|
||||
STATUS_CONNECTED_STR='{"text":"", "tooltip":"Tunnel connected."}'
|
||||
STATUS_DISCONNECTED_STR='{"text":"", "tooltip":"Tunnel disconnected"}'
|
||||
|
||||
function status_wireguard() {
|
||||
systemctl is-active $SERVICE_NAME >/dev/null 2>&1
|
||||
return $?
|
||||
}
|
||||
|
||||
status_wireguard && echo $STATUS_CONNECTED_STR || echo $STATUS_DISCONNECTED_STR
|
Reference in New Issue
Block a user