add preview screenshot

This commit is contained in:
DACHXY 2025-03-10 16:39:41 +08:00
parent 796176480e
commit a304926231
7 changed files with 47 additions and 1 deletions

View file

@ -2,6 +2,10 @@
--- ---
## 📷 Preview
![preview](./preview.png)
## ✨ Main Applications ## ✨ Main Applications
- [X] Hyprland - [X] Hyprland

20
home/config/scripts/wgStatus.sh Executable file
View file

@ -0,0 +1,20 @@
#!/usr/bin/env bash
INTERFACE="wg0"
if [ "$1" = "toggle" ]; then
if ip link show "$INTERFACE" >/dev/null 2>&1; then
pkexec wg-quick down "$INTERFACE"
else
pkexec wg-quick up "$INTERFACE"
fi
exit 0
fi
if ! ip link show "$INTERFACE" >/dev/null 2>&1; then
echo "{\"text\": \"Not Connected\", \"tooltip\": \"WireGuard is down\", \"alt\": \"disconnected\", \"class\": \"disconnected\"}"
exit 0
fi
echo "{\"text\": \"Connected\", \"tooltip\": \"WireGuard connected\", \"alt\": \"connected\", \"class\": \"connected\"}"
exit 0

View file

@ -26,6 +26,7 @@
"modules-right": [ "modules-right": [
"wlr/taskbar", "wlr/taskbar",
"custom/wireguard",
"idle_inhibitor", "idle_inhibitor",
"network", "network",
"cpu", "cpu",
@ -83,6 +84,7 @@
"modules-right": [ "modules-right": [
"wlr/taskbar", "wlr/taskbar",
"custom/wireguard",
"temperature", "temperature",
"idle_inhibitor", "idle_inhibitor",
"network", "network",

View file

@ -215,5 +215,20 @@
"activated": "󰅶", "activated": "󰅶",
"deactivated": "󰾫" "deactivated": "󰾫"
} }
},
"custom/wireguard": {
"format": "{icon}",
"format-icons": {
"connected": "󰒘",
"disconnected": ""
},
"exec": "~/.config/scripts/wgStatus.sh",
"exec-if": "which wg-quick",
"on-click": "~/.config/scripts/wgStatus.sh toggle",
"tooltip": true,
"interval": 3,
"return-type": "json",
"escape": true
} }
} }

View file

@ -42,6 +42,7 @@ tooltip label {
#idle_inhibitor, #idle_inhibitor,
#custom-cava, #custom-cava,
#custom-wireguard,
#clock, #clock,
#cpu, #cpu,
#memory, #memory,
@ -78,6 +79,7 @@ tooltip label {
#memory #memory
#temperature, #temperature,
#network, #network,
#custom-wireguard,
#battery { #battery {
margin-left: 4px; margin-left: 4px;
} }
@ -123,6 +125,7 @@ tooltip label {
/* Center Icon */ /* Center Icon */
#custom-os, #custom-os,
#custom-wireguard,
#network, #network,
#idle_inhibitor { #idle_inhibitor {
padding-left: 10px; padding-right: 14px; padding-left: 10px; padding-right: 14px;

BIN
preview.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 MiB

View file

@ -1,4 +1,6 @@
{ lib, ... }: {
...
}:
let let
configPath = "/etc/wireguard/wg0.conf"; configPath = "/etc/wireguard/wg0.conf";
in in