vpn button waybar

This commit is contained in:
2025-05-28 11:25:40 +02:00
parent d3523ebde6
commit 341472929b
7 changed files with 73 additions and 17 deletions

View File

@ -0,0 +1,3 @@
#!/bin/bash
rofi -dmenu -password -no-fixed-num-lines -p "Sudo password"

View 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

View File

@ -0,0 +1,16 @@
#!/bin/bash
SERVICE_NAME="wg-quick@wg0"
function status_wireguard() {
systemctl is-active $SERVICE_NAME >/dev/null 2>&1
return $?
}
function askpass() {
rofi -dmenu -password -no-fixed-num-lines -p "Sudo password"
}
status_wireguard && \
SUDO_ASKPASS=~/.config/waybar/scripts/askpass.sh sudo -A systemctl stop $SERVICE_NAME || \
SUDO_ASKPASS=~/.config/waybar/scripts/askpass.sh sudo -A systemctl start $SERVICE_NAME