Display your public and private IP addresses in the tmux status bar.
Add this plugin to your ~/.tmux.conf:
set -g @plugin 'tmux-contrib/tmux-network'And install it by running <prefix> + I.
Add the format strings to your status bar:
set -g status-right "#{network_private_ip} | #{network_public_ip}"| Format String | Description |
|---|---|
#{network_public_ip} |
Public IP address (from ip-api.com) |
#{network_private_ip} |
Private IP address (from en0 interface) |
Install dependencies using Nix:
nix developOr install manually: bash, tmux, bats
bats tests/Enable trace output with the DEBUG environment variable:
DEBUG=1 /path/to/tmux-network/scripts/tmux_network.sh get-public-ipMIT