Commit Graph

5 Commits

Author SHA1 Message Date
dissimulo 0eb605a835 tmux statusline: directly-held WAN/LAN IP, offline ✕, native window-status
- tmux-ip: show the first directly-held public/WAN IP on a non-tunnel interface,
  else the LAN/private IP. No external 'what's my IP' lookup and no DigitalOcean
  special-case (a droplet's eth0 public IP is found by the same interface scan);
  RFC1918/link-local/CGNAT classed as not-WAN, so a NAT'd box shows its LAN IP.
- tmux-net: show ✕ when there's no local IP and no VPN tunnel (offline). VPN ⇡
  overlay unchanged.
- .tmux.conf: window-status icon + path now native tmux formats (no per-redraw
  #() forks); tmux-window-icon kept as fallback.
2026-06-30 16:39:52 -07:00
dissimulo 467b967ced tmux-ip: portable local-IP fallback for macOS
`hostname -I` is GNU-only and errors on BSD/macOS, so when the public-IP
curl couldn't reach api.ipify.org the script printed nothing and the
tmux status bar showed an empty IP. Try `ipconfig getifaddr` for common
interfaces first, fall back to `hostname -I` on Linux, then `ifconfig`
as a last resort. Also guard against empty-but-zero-exit curl output.
2026-05-17 03:12:11 -07:00
dissimulo 18ddfc9ad6 tmux-ip: fix DO metadata path (address -> ip_address)
The DigitalOcean metadata endpoint for reserved/floating IPv4 is
/metadata/v1/{reserved,floating}_ip/ipv4/ip_address, not .../address.
The .../active check works but the wrong IP path returned an empty
body, causing the script to silently fall through to ipify on every
droplet with a reserved/floating IP attached.

Verified on a droplet:
  curl .../reserved_ip/ipv4/ip_address -> 45.55.111.240
  curl .../reserved_ip/ipv4/address    -> (empty)
2026-04-21 07:20:51 -07:00
dissimulo 129d77471b tmux-ip: prefer DigitalOcean reserved/floating IP when on a droplet
If /sys/class/dmi/id/sys_vendor says DigitalOcean and the droplet has
a reserved_ip or floating_ip assigned, use that over the ipify-based
egress IP. Keeps the ipify/hostname -I fallback intact for other hosts.

Gated on the DMI check so non-DO hosts skip the metadata probe entirely
and the tmux status bar refresh stays fast.
2026-04-21 07:10:13 -07:00
dissimulo 0affdd1fb7 Add tmux-ip helper script with public/internal IP fallback 2026-04-21 06:16:16 -07:00