diff options
| author | Robert Günzler <r@gnzler.io> | 2026-09-27 17:38:39 +0200 |
|---|---|---|
| committer | Robert Günzler <r@gnzler.io> | 2026-09-27 17:38:39 +0200 |
| commit | 0860db73ae6fd9a6f6347219d820bf026a6b8b91 (patch) | |
| tree | 11318c3670d1c32c5aa0bf404c22fba3bf63fc53 /.config/waybar/module-tailscale.sh | |
| parent | 4e34cbf9673aeaba252e01df554a0d204e83c5e2 (diff) | |
| download | dotfiles-0860db73ae6fd9a6f6347219d820bf026a6b8b91.tar.gz | |
Automated-commit-by: dots Signed-off-by: Robert Günzler <r@gnzler.io>
Diffstat (limited to '.config/waybar/module-tailscale.sh')
| -rwxr-xr-x | .config/waybar/module-tailscale.sh | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/.config/waybar/module-tailscale.sh b/.config/waybar/module-tailscale.sh index 53b0409..3a2ce75 100755 --- a/.config/waybar/module-tailscale.sh +++ b/.config/waybar/module-tailscale.sh @@ -15,16 +15,19 @@ update() { alt="$ts_acct" class="$ts_acct" + tip="$ts_ip" # only display account name when not "main" [ "$ts_acct" = "main" ] || text=$ts_acct - if tailscale exit-node list | grep -q selected; then + en_name=$(tailscale exit-node list | grep selected) + if test -n "$en_name"; then alt="exit-node" class="exit-node" + tip="$(awk '{printf "%s (%s)", $2, $1}' <<<"$en_name")" fi jq -nrc '{text:$text,tooltip:$tip,class:$class,alt:$alt}' \ - --arg tip "${ts_ip:?}" \ + --arg tip "${tip:?}" \ --arg class "${class:?}" \ --arg alt "${alt:?}" \ --arg text "${text:-}" |