feat(waybar): update

This commit is contained in:
2026-02-23 19:35:58 +01:00
parent 6bcf153975
commit aef8985b3e
4 changed files with 23 additions and 0 deletions

View File

@@ -15,6 +15,7 @@
"pulseaudio",
"clock",
"clock#simpleclock",
"custom/tailscale",
"network",
"battery",
"tray",
@@ -151,6 +152,13 @@
"return-type": "json",
"tooltip": false,
},
"custom/tailscale": {
"exec": "~/.config/waybar/scripts/tailscale.sh",
"interval": 5,
"return-type": "json",
"on-click": "~/.config/waybar/scripts/tailscale-toggle.sh",
"tooltip": true
},
"network": {
"interface": "wlp1s0",
"format": "",

View File

@@ -0,0 +1,7 @@
#!/usr/bin/env bash
if tailscale status --json 2>/dev/null | grep -q '"BackendState": "Running"'; then
tailscale down
else
tailscale up
fi

7
waybar/scripts/tailscale.sh Executable file
View File

@@ -0,0 +1,7 @@
#!/usr/bin/env bash
if tailscale status --json 2>/dev/null | grep -q '"BackendState": "Running"'; then
echo '{"text":"󰖂 Connected","class":"connected","tooltip":"Tailscale Connected"}'
else
echo '{"text":"󱗼 Disconnected","class":"disconnected","tooltip":"Tailscale Disconnected"}'
fi

View File

@@ -76,6 +76,7 @@ window#waybar {
#custom-power,
#custom-spotify,
#custom-notification,
#custom-tailscale,
#cpu,
#tray,
#memory,