Skip to content

Display the primary IP address in tmux status bar

License

Notifications You must be signed in to change notification settings

bw1faeh0/tmux-primary-ip

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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:

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. Add the following configuration custom_modules/primary_ip.conf:

%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:

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

About

Display the primary IP address in tmux status bar

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%