diff --git a/roles/bash/files/profile b/roles/bash/files/profile index 6dc28a6..5e5eb3a 100644 --- a/roles/bash/files/profile +++ b/roles/bash/files/profile @@ -252,9 +252,9 @@ _update_colors() { PS1_SEP_COLOR=$(tput setaf $Base01) fi - if [ -n "$TMUX" ] && [ -f "$HOME/.tmux.conf" ]; then + if [ -n "$TMUX" ] && [ -f "$XDG_CONFIG_HOME/tmux/tmux-colors.conf" ]; then tmux set-environment -g BACKGROUND "$BACKGROUND" - tmux source-file "$HOME/.tmux.conf" + tmux source-file "$XDG_CONFIG_HOME/tmux/tmux-colors.conf" fi local ls_colors="$HOME/.config/dircolors/solarized-$BACKGROUND" diff --git a/roles/tmux/files/tmux-colors.conf b/roles/tmux/files/tmux-colors.conf new file mode 100644 index 0000000..c72d9b4 --- /dev/null +++ b/roles/tmux/files/tmux-colors.conf @@ -0,0 +1,16 @@ +# Default to solarized dark. +set -g status-fg colour3 # Yellow +set -g status-bg colour0 # Base02 +setw -g window-status-style fg=colour12,bg=default # Base0 on Transparent +setw -g window-status-current-style fg=colour9,bg=default # Orange on Transparent +set -g pane-border-style fg=colour0 # Base02 +set -g pane-active-border-style fg=colour14 # Base1 + +%if #{==:#{BACKGROUND},light} + set -g status-fg colour13 # Violet + set -g status-bg colour7 # Base2 + setw -g window-status-style fg=colour11,bg=default # Base00 on Transparent + setw -g window-status-current-style fg=colour5,bg=default # Magenta on Transparent + set -g pane-border-style fg=colour7 # Base2 + set -g pane-active-border-style fg=colour10 # Base01 +%endif diff --git a/roles/tmux/files/tmux.conf b/roles/tmux/files/tmux.conf index f279a69..54f0904 100644 --- a/roles/tmux/files/tmux.conf +++ b/roles/tmux/files/tmux.conf @@ -55,21 +55,7 @@ set-environment -gu SHLVL # # Colors # -set -g status-fg colour3 # Yellow -set -g status-bg colour0 # Base02 -setw -g window-status-style fg=colour12,bg=default # Base0 on Transparent -setw -g window-status-current-style fg=colour9,bg=default # Orange on Transparent -set -g pane-border-style fg=colour0 # Base02 -set -g pane-active-border-style fg=colour14 # Base1 - -%if #{==:#{BACKGROUND},light} - set -g status-fg colour13 # Violet - set -g status-bg colour7 # Base2 - setw -g window-status-style fg=colour11,bg=default # Base00 on Transparent - setw -g window-status-current-style fg=colour5,bg=default # Magenta on Transparent - set -g pane-border-style fg=colour7 # Base2 - set -g pane-active-border-style fg=colour10 # Base01 -%endif +source-file -q "$XDG_CONFIG_HOME/tmux/tmux-colors.conf" # Fix for clipboard in vim running inside tmux: # See http://www.economyofeffort.com/2013/07/29/reattach-to-user-namespace-the-fix-for-your-tmux-in-os-x-woes/ diff --git a/roles/tmux/tasks/main.yml b/roles/tmux/tasks/main.yml index 2e04c96..f8367ce 100644 --- a/roles/tmux/tasks/main.yml +++ b/roles/tmux/tasks/main.yml @@ -14,8 +14,10 @@ - name: Deploy tmux config file: - src: "{{ role_path }}/files/tmux.conf" - dest: ~/.config/tmux/tmux.conf + src: "{{ role_path }}/files/{{ item }}" + dest: "~/.config/tmux/{{ item }}" state: link force: yes - + loop: + - tmux.conf + - tmux-colors.conf