I'm trying to make my tmux config a little more modular by abstracting the colors to a separate file. I'm sourcing that file and then using the variables defined there as my tmux theme:# part of my tmux.conf:source '~/.tmux/themes/gruvbox'# status barset -g status onset -g status-attr noneset -g status-justify leftset -g status-bg $TMUX_STATUS_BG# status leftset -g status-left-attr noneset -g status-left-length 100# status rightset -g status-right-attr noneset -g status-right-length 100# windowsetw -g window-status-attr nonesetw -g window-status-separator # this isn't picked upsetw -g window-status-format #[fg=$TMUX_WINDOW_STATUS_FG,bg=$TMUX_WINDOW_STATUS_BG] #I | #W # active windowsetw -g window-status-activity-attr none# this isn't picked up eithersetw -g window-status-current-format #[fg=$TMUX_ACTIVE_WINDOW_STATUS_FG,bg=$TMUX_ACTIVE_WINDOW_STATUS_BG] #I | #W # panesset -g pane-active-border-fg $TMUX_ACTIVE_BORDER_FGset -g pane-border-fg $TMUX_BORDER_FG# command barset -g message-command-fg $TMUX_MESSAGE_COMMAND_FGset -g message-command-bg $TMUX_MESSAGE_COMMAND_BGset -g message-fg $TMUX_MESSAGE_FGset -g message-bg $TMUX_MESSAGE_BGand this is where I set the colors# ~/.tmux/themes/gruvboxTMUX_STATUS_BG=#3c3836TMUX_ACTIVE_BORDER_FG=#fabd2fTMUX_BORDER_FG=#3c3836TMUX_MESSAGE_COMMAND_FG=#a89984TMUX_MESSAGE_COMMAND_BG=#3c3836TMUX_MESSAGE_FG=#a89984TMUX_MESSAGE_BG=#3c3836# these aren't picked up, the above vars areTMUX_WINDOW_STATUS_FG=#a89984TMUX_WINDOW_STATUS_BG=#3c3836TMUX_ACTIVE_WINDOW_STATUS_FG=#282828TMUX_ACTIVE_WINDOW_STATUS_BG=#fabd2fIt's mostly working, except for the window status variables, which tmux doesn't apply. Do they need a different syntax? If so, which?
Why does tmux not pick up the variables sourced in my tmux.conf?
environment variables;tmux;colors
So the window-status setting doesn't allow for the interpolation of variables. But, you can use a script to echo the window config. In that script variables can be used. So in your .tmux.conf you could do something like:setw -g window-status-current-format #(~/.tmux/window.sh current)setw -g window-status-format #(~/.tmux/window.sh)And in window.sh (or any other script):#!/bin/bashif [[ $1 == current ]]; then  echo #[fg=${TMUX_CURRENT_WINDOW_FG},bg=${TMUX_CURRENT_WINDOW_BG}] #I | #W else  echo #[fg=${TMUX_WINDOW_FG},bg=${TMUX_WINDOW_BG}] #I | #W fiThat does work.