tmux-net: always prefix local IP with home symbol

Show ⌂ before the local IP whether or not a VPN is up. The VPN branch
already prefixes ⌂; the non-VPN branch was emitting the bare IP.
This commit is contained in:
2026-05-17 03:58:11 -07:00
parent e2a1e3b784
commit 3d6f13b2bc

View File

@@ -1,8 +1,8 @@
#!/bin/bash #!/bin/bash
# #
# Emit the tmux status-bar network segment. # Emit the tmux status-bar network segment.
# No VPN: "<local_ip>" # No VPN: "<local_ip>"
# VPN up: "<local_ip> (local) / <vpn_ip> (vpn)" # VPN up: "<local_ip> / ⇡ <vpn_ip>"
# #
set -u set -u
@@ -13,5 +13,5 @@ vpn_ip=$("$HOME/.local/bin/tmux-vpn-ip" 2>/dev/null || true)
if [ -n "${vpn_ip:-}" ]; then if [ -n "${vpn_ip:-}" ]; then
printf '\xe2\x8c\x82 %s / \xe2\x87\xa1 %s\n' "${local_ip:-}" "$vpn_ip" printf '\xe2\x8c\x82 %s / \xe2\x87\xa1 %s\n' "${local_ip:-}" "$vpn_ip"
else else
printf '%s\n' "${local_ip:-}" printf '\xe2\x8c\x82 %s\n' "${local_ip:-}"
fi fi