-
I have multiple theme files in my themes directory, how do i change between themes without going to my powerlinerc and modifying the export? I tried exporting TMUX_POWERLINE_THEME from a bash script but that doesn’t work |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Hey, tmux-powerline will read the |
Beta Was this translation helpful? Give feedback.
-
Hi thanks for your response, here’s what i tried
in shell
How do I set the colorscheme variable? |
Beta Was this translation helpful? Give feedback.
-
As tmux-powerline will source you Usually the [...]
# 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 Then the question is how you would set this envvar? Setting it in a shell inside tmux will not have any effect, because that shell is unrelated to the shell that tmux will spawn when executing an update to render the left and right statuses. Maybe the shell that tmux spawns will read your shells initialization files like However this does not sound very useful to me. If your goal is to be able to change the theme by typing $ export TMUX_POWERLINE_THEME="some-theme" in a shell inside tmux, I would say this is not possible. However the only thing you need to do is to update the
and change your if [ -e $HOME/.tmux-powerline-theme ]; then
export TMUX_POWERLINE_THEME="$(cat $HOME/.tmux-powerline-theme)"
fi Now you can change the theme by just doing
(and make the theme script executable and add it to your PATH of course) I hope this can help you to develop your own solution :) |
Beta Was this translation helpful? Give feedback.
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: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
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…