feat(waybar): update
This commit is contained in:
@@ -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": "",
|
||||
|
||||
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-spotify,
|
||||
#custom-notification,
|
||||
#custom-tailscale,
|
||||
#cpu,
|
||||
#tray,
|
||||
#memory,
|
||||
|
||||
Reference in New Issue
Block a user