Skip to content

Is it possible to switch between themes using the TMUX_POWERLINE_THEME variable? #280

Answered by erikw
Ceres445 asked this question in Q&A
Discussion options

You must be logged in to vote

As tmux-powerline will source you config.sh each time it renders, this is where we need to look.

Usually the ~/.tmux-powerlinerc looks like:

[...]
# The theme to use.
export TMUX_POWERLINE_THEME="default"
[...]

But as this file is sourced like shell script, you can add your own logic like setting the theme variable only if not already set like

# The theme to use. Don't override if already set in the environment.
if [ -z ${TMUX_POWERLINE_THEME+x} ]; then
        export TMUX_POWERLINE_THEME="default"
fi

Then tmux-powerline would use the value of $TMUX_POWERLINE_THEME from the evironment, not from the config, if set.

Then the question is how you would set this envvar? Setting it in a shell i…

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@Ceres445
Comment options

Answer selected by erikw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants