Rename setcolors to setenv, add documentation
This commit is contained in:
parent
d62336f7a2
commit
1348472f1e
|
@ -77,7 +77,9 @@ def source_tmux_files(pl, args):
|
|||
run_tmux_command('refresh-client')
|
||||
|
||||
|
||||
def init_color_variables(pl, args):
|
||||
def init_environment(pl, args):
|
||||
'''Initialize tmux environment from tmux configuration
|
||||
'''
|
||||
powerline = TmuxPowerline(args.config_path)
|
||||
# TODO Move configuration files loading out of Powerline object and use it
|
||||
# directly
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
if-shell 'test -z "$POWERLINE_CONFIG_COMMAND"' 'set-environment -g POWERLINE_CONFIG_COMMAND powerline-config'
|
||||
|
||||
run-shell 'eval $POWERLINE_CONFIG_COMMAND tmux setcolors'
|
||||
run-shell 'eval $POWERLINE_CONFIG_COMMAND tmux setenv'
|
||||
|
||||
# Simplify tmux version checking by using multiple config files. Source these
|
||||
# config files based on the version in which tmux features were added and/or
|
||||
|
|
|
@ -20,7 +20,7 @@ class StrFunction(object):
|
|||
|
||||
TMUX_ACTIONS = {
|
||||
'source': StrFunction(config.source_tmux_files, 'source'),
|
||||
'setcolors': StrFunction(config.init_color_variables, 'setcolors'),
|
||||
'setenv': StrFunction(config.init_environment, 'setenv'),
|
||||
}
|
||||
|
||||
|
||||
|
@ -51,7 +51,7 @@ def get_argparser(ArgumentParser=ConfigArgParser):
|
|||
choices=tuple(TMUX_ACTIONS.values()),
|
||||
metavar='ACTION',
|
||||
type=(lambda v: TMUX_ACTIONS.get(v)),
|
||||
help='If action is `source\' then version-specific tmux configuration files are sourced.'
|
||||
help='If action is `source\' then version-specific tmux configuration files are sourced, if it is `setenv\' then special (prefixed with `_POWERLINE\') tmux global environment variables are filled with data from powerline configuration.'
|
||||
)
|
||||
|
||||
shell_parser = subparsers.add_parser('shell', help='Shell-specific commands')
|
||||
|
|
Loading…
Reference in New Issue