feat(waybar): update
This commit is contained in:
@@ -15,6 +15,7 @@
|
|||||||
"pulseaudio",
|
"pulseaudio",
|
||||||
"clock",
|
"clock",
|
||||||
"clock#simpleclock",
|
"clock#simpleclock",
|
||||||
|
"custom/tailscale",
|
||||||
"network",
|
"network",
|
||||||
"battery",
|
"battery",
|
||||||
"tray",
|
"tray",
|
||||||
@@ -151,6 +152,13 @@
|
|||||||
"return-type": "json",
|
"return-type": "json",
|
||||||
"tooltip": false,
|
"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": {
|
"network": {
|
||||||
"interface": "wlp1s0",
|
"interface": "wlp1s0",
|
||||||
"format": "",
|
"format": "",
|
||||||
|
|||||||
7
waybar/scripts/tailscale-toggle.sh
Executable file
7
waybar/scripts/tailscale-toggle.sh
Executable 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
7
waybar/scripts/tailscale.sh
Executable 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
|
||||||
@@ -76,6 +76,7 @@ window#waybar {
|
|||||||
#custom-power,
|
#custom-power,
|
||||||
#custom-spotify,
|
#custom-spotify,
|
||||||
#custom-notification,
|
#custom-notification,
|
||||||
|
#custom-tailscale,
|
||||||
#cpu,
|
#cpu,
|
||||||
#tray,
|
#tray,
|
||||||
#memory,
|
#memory,
|
||||||
|
|||||||
Reference in New Issue
Block a user