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 bar
set -g status "on"
set -g status-attr "none"
set -g status-justify "left"
set -g status-bg $TMUX_STATUS_BG
# status left
set -g status-left-attr "none"
set -g status-left-length "100"
# status right
set -g status-right-attr "none"
set -g status-right-length "100"
# window
setw -g window-status-attr "none"
setw -g window-status-separator ""
# this isn't picked up
setw -g window-status-format "#[fg=$TMUX_WINDOW_STATUS_FG,bg=$TMUX_WINDOW_STATUS_BG] #I | #W "
# active window
setw -g window-status-activity-attr "none"
# this isn't picked up either
setw -g window-status-current-format "#[fg=$TMUX_ACTIVE_WINDOW_STATUS_FG,bg=$TMUX_ACTIVE_WINDOW_STATUS_BG] #I | #W "
# panes
set -g pane-active-border-fg $TMUX_ACTIVE_BORDER_FG
set -g pane-border-fg $TMUX_BORDER_FG
# command bar
set -g message-command-fg $TMUX_MESSAGE_COMMAND_FG
set -g message-command-bg $TMUX_MESSAGE_COMMAND_BG
set -g message-fg $TMUX_MESSAGE_FG
set -g message-bg $TMUX_MESSAGE_BG
and this is where I set the colors
# ~/.tmux/themes/gruvbox
TMUX_STATUS_BG="#3c3836"
TMUX_ACTIVE_BORDER_FG="#fabd2f"
TMUX_BORDER_FG="#3c3836"
TMUX_MESSAGE_COMMAND_FG="#a89984"
TMUX_MESSAGE_COMMAND_BG="#3c3836"
TMUX_MESSAGE_FG="#a89984"
TMUX_MESSAGE_BG="#3c3836"
# these aren't picked up, the above vars are
TMUX_WINDOW_STATUS_FG="#a89984"
TMUX_WINDOW_STATUS_BG="#3c3836"
TMUX_ACTIVE_WINDOW_STATUS_FG="#282828"
TMUX_ACTIVE_WINDOW_STATUS_BG="#fabd2f"
It's mostly working, except for the window status variables, which tmux doesn't apply. Do they need a different syntax? If so, which?
.../.tmux.conf:7: bad colour:for everysetline using one of these variables -- but no error for thesetwlines, oddly.#(~/script.sh)which then echos the config and resolves the variables. Which does work.source-filenotsource