committing random WM stuff

This commit is contained in:
2026-03-24 00:03:59 +01:00
parent a7c0018684
commit cb15e83811
70 changed files with 5428 additions and 1 deletions

30
toggle_wg.sh Normal file
View File

@@ -0,0 +1,30 @@
#!/usr/bin/env bash
## Script to toggle WireGuard tunnel using wg command for state determination
# Define the WireGuard interface name
WG_INTERFACE="wg0"
# Function to check if WireGuard interface is active
is_wg_active() {
sudo /usr/bin/wg show | grep -q "interface"
}
if is_wg_active; then
# If the interface is active, disable it
sudo /usr/bin/wg-quick down "$WG_INTERFACE"
if ! is_wg_active; then
notify-send -h string:x-canonical-private-synchronous:sys-notify -u low -i network-vpn "WireGuard Tunnel" "Tunnel Deactivated"
else
notify-send --urgency=critical -i network-vpn "WireGuard Tunnel" "Error: Failed to deactivate tunnel"
fi
else
# If the interface is not active, enable it
sudo /usr/bin/wg-quick up "$WG_INTERFACE"
if is_wg_active; then
notify-send -h string:x-canonical-private-synchronous:sys-notify -u low -i network-vpn "WireGuard Tunnel" "Tunnel Activated"
else
notify-send --urgency=critical -i network-vpn "WireGuard Tunnel" "Error: Failed to activate tunnel"
fi
fi