-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(waybar): add tailscale indicator
- Loading branch information
Showing
3 changed files
with
44 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
home/private_dot_config/waybar/scripts/executable_tailscale.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env bash | ||
|
||
if tailscale status &>/dev/null; then | ||
if tailscale exit-node list | grep -q selected; then | ||
tooltip=$(tailscale exit-node list | grep selected | awk '{print $2" "$3}') | ||
echo "{\"text\": \" \", \"class\": \"enabled\", \"tooltip\": \"${tooltip}\"}" | ||
else | ||
tooltip="No exit-node assigned" | ||
echo "{\"text\": \" \", \"class\": \"disabled\", \"tooltip\": \"${tooltip}\"}" | ||
fi | ||
else | ||
tooltip="Tailscale is not connected" | ||
echo "{\"text\": \" \", \"class\": \"disabled\", \"tooltip\": \"${tooltip}\"}" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters