https://github.com/dreknix/tmux-primary-ip
Display the primary IP address in tmux status bar
https://github.com/dreknix/tmux-primary-ip
tmux tmux-plugins
Last synced: 9 months ago
JSON representation
Display the primary IP address in tmux status bar
- Host: GitHub
- URL: https://github.com/dreknix/tmux-primary-ip
- Owner: dreknix
- License: mit
- Created: 2024-07-30T14:45:54.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-04-17T08:12:58.000Z (about 1 year ago)
- Last Synced: 2025-04-17T22:58:12.426Z (about 1 year ago)
- Topics: tmux, tmux-plugins
- Language: Shell
- Homepage:
- Size: 13.7 KB
- Stars: 3
- Watchers: 1
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Tmux Primary IP
A tmux plugin that displays the primary IP address in the status bar.
The plugin introduces a new `#{primary_ip}` format.
The status bar is updated every `status-interval` seconds. If the option is not
set, the status bar is updated every 15 seconds.
## Installation with Tmux Plugin Manager
Add plugin to the list of TPM plugins in `~/.config/tmux/tmux.conf`:
``` plain
set -g plugin 'dreknix/tmux-primary-ip'
```
Hit `prefix + I` to install the plugin and source it.
The `#{primary_ip}` interpolation should now work.
## Customization
The plugin can be used with the [Catppuccin theme](https://github.com/catppuccin/tmux).
Add the following configuration `custom_modules/primary_ip.conf`:
``` plain
%hidden MODULE_NAME='primary_ip'
set -ogq "@catppuccin_${MODULE_NAME}_icon" '#{l:#{primary_ip_icon}} '
set -ogqF "@catppuccin_${MODULE_NAME}_color" '#{E:@thm_lavender}'
set -ogq "@catppuccin_${MODULE_NAME}_text" '#{l:#{primary_ip}}'
source -F '#{TMUX_PLUGIN_MANAGER_PATH}/tmux/utils/status_module.conf'
```
Add the following lines into `tmux.conf`:
``` plain
set-environment -gF TMUX_PLUGIN_MANAGER_PATH '#{HOME}/.local/share/tmux/plugins/'
run '#{TMUX_PLUGIN_MANAGER_PATH}/tmux/catppuccin.tmux'
source -F '#{d:current_file}/custom_modules/primary_ip.conf'
set -agF status-right '#{E:@catppuccin_status_primary_ip}'
```
## License
[MIT](https://github.com/dreknix/tmux-primary-ip/blob/main/LICENSE)