diff options
author | awy <awy@tutamail.com> | 2024-08-14 22:51:37 +0300 |
---|---|---|
committer | awy <awy@tutamail.com> | 2024-08-14 22:51:37 +0300 |
commit | 88d959b959e4e7e05755b7f340829e4241c625b8 (patch) | |
tree | baa426738c215ec96feb3c66b8af7ee5f4926c2c | |
parent | ba0d4321e1ca37708258b9097bd5b76d0ce050c7 (diff) |
vpn
-rw-r--r-- | .config/waybar/config | 8 | ||||
-rwxr-xr-x | .config/waybar/scripts/vpn-toggle | 8 | ||||
-rw-r--r-- | .config/waybar/style.css | 25 |
3 files changed, 36 insertions, 5 deletions
diff --git a/.config/waybar/config b/.config/waybar/config index cf404ff..c4dca4d 100644 --- a/.config/waybar/config +++ b/.config/waybar/config @@ -5,7 +5,7 @@ "reload_style_on_change": true, "modules-left": ["hyprland/workspaces","custom/separator","hyprland/window"], "modules-center": [], - "modules-right": ["custom/pacman", "custom/weather","memory","temperature", "custom/separator", "image", "pulseaudio","wireplumber", "custom/separator", "clock","tray"], + "modules-right": ["network", "custom/weather","memory", "custom/separator", "image", "pulseaudio","wireplumber", "custom/separator", "clock","tray"], "hyprland/window": { "format": "{}", @@ -36,9 +36,11 @@ }, }, "network": { + "interface": "wg0", "tooltip": false, - "interval": 5, - "format": " {bandwidthDownBytes} {bandwidthUpBytes}", + "format": "VPN", + "format-disconnected": "VPN", + "on-click": "~/.config/waybar/scripts/vpn-toggle", }, "tray": { "spacing": 10 diff --git a/.config/waybar/scripts/vpn-toggle b/.config/waybar/scripts/vpn-toggle new file mode 100755 index 0000000..4b48203 --- /dev/null +++ b/.config/waybar/scripts/vpn-toggle @@ -0,0 +1,8 @@ +#!/bin/sh +if [ -d /sys/class/net/wg0 ]; then + doas wg-quick down wg0 + hyprctl notify 5 5000 "rgb(ff0000)" " VPN is disabled" +else + doas wg-quick up wg0 + hyprctl notify 5 5000 "rgb(008000)" " VPN is enabled" +fi diff --git a/.config/waybar/style.css b/.config/waybar/style.css index 0d12a29..017b1cf 100644 --- a/.config/waybar/style.css +++ b/.config/waybar/style.css @@ -63,8 +63,29 @@ tooltip { } #network { - margin-left: 15px; - color: @blue; + margin-right: 5px; + color: @green; + border: 1px; + border-style: solid; + border-color: rgba(100,100,100,0.5); + background: rgba(0, 0, 0,0.3); + margin-top: 8px; + margin-bottom: 8px; + border-radius: 8px; + padding: 8px; +} + +#network.disconnected { + margin-right: 5px; + color: @red; + border: 1px; + border-style: solid; + border-color: rgba(100,100,100,0.5); + background: rgba(0, 0, 0,0.3); + margin-top: 8px; + margin-bottom: 8px; + border-radius: 8px; + padding: 8px; } #custom-weather { |