A tmux
plugin is just a shell script in a conventional place
(~/.tmux/plugins/
) that the plugin manager will look for and run using
the built-in tmux run-shell
command. It is just packaging for
cleanliness. The shell script implements everything else with the standard
built-in tmux commands. You cannot add any new ones. See man tmux
for all
the commands.
If you look at the cpu plugin, it allows you to have new status line options like #{cpu_percentage}
. To do this it uses
tmux show-option -gqv status-right
to find your wanted configuration string, and replaces matching options by a call to one of the
other shell scripts provided by the plugin, namely in this case
#(~/.tmux/plugins/tmux-cpu/scripts/cpu_percentage.sh)
The form #()
is
standard built-in tmux syntax to run a shell command from the value of status-right
and other variables. See the man page under section FORMATS.
The updated status-right
string is given back to tmux with tmux set-option -qg status-right
.