From 47a5debc449f4f1d62d56107a44c66ddf83997c8 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Tue, 5 Jun 2012 23:04:55 +1200 Subject: Add colour conditionals to tmux conf This way it makes sense when used in a Linux console or anything else not smart enough to have 256 colours --- tmux/tmux.conf | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'tmux') diff --git a/tmux/tmux.conf b/tmux/tmux.conf index bd221906..673ca076 100644 --- a/tmux/tmux.conf +++ b/tmux/tmux.conf @@ -34,39 +34,39 @@ bind-key K swap-pane -U # Activity set-window-option -g monitor-activity on set-window-option -g window-status-activity-attr none -set-window-option -g window-status-activity-bg colour237 -set-window-option -g window-status-activity-fg colour248 +if-shell 'test `tput colors` -eq 256' 'set-window-option -g window-status-activity-bg colour237' +if-shell 'test `tput colors` -eq 256' 'set-window-option -g window-status-activity-fg colour248' # Indices set-option -g base-index 1 # Messages -set-option -g message-bg colour18 -set-option -g message-fg colour231 +if-shell 'test `tput colors` -eq 256' 'set-option -g message-bg colour18' +if-shell 'test `tput colors` -eq 256' 'set-option -g message-fg colour231' # Modes set-window-option -g mode-keys vi -set-window-option -g mode-bg colour18 -set-window-option -g mode-fg colour231 +if-shell 'test `tput colors` -eq 256' 'set-window-option -g mode-bg colour18' +if-shell 'test `tput colors` -eq 256' 'set-window-option -g mode-fg colour231' # Pane borders -set-option -g pane-active-border-bg colour237 -set-option -g pane-active-border-fg colour237 -set-option -g pane-border-bg colour237 -set-option -g pane-border-fg colour237 +if-shell 'test `tput colors` -eq 256' 'set-option -g pane-active-border-bg colour237' +if-shell 'test `tput colors` -eq 256' 'set-option -g pane-active-border-fg colour237' +if-shell 'test `tput colors` -eq 256' 'set-option -g pane-border-bg colour237' +if-shell 'test `tput colors` -eq 256' 'set-option -g pane-border-fg colour237' # Status bar -set-option -g status-bg colour237 -set-option -g status-fg colour248 set-option -g status-left '[#S]' set-option -g status-right '[#H] #(date +"%F %T")' -set-window-option -g window-status-current-format "#[fg=colour231]#I:#W#F" -set-window-option -g window-status-format "#[fg=colour16]#I:#W#F" +if-shell 'test `tput colors` -eq 256' 'set-option -g status-bg colour237' +if-shell 'test `tput colors` -eq 256' 'set-option -g status-fg colour248' +if-shell 'test `tput colors` -eq 256' 'set-window-option -g window-status-current-format "#[fg=colour231]#I:#W#F"' +if-shell 'test `tput colors` -eq 256' 'set-window-option -g window-status-format "#[fg=colour16]#I:#W#F"' # Terminal -set-option -g default-terminal "screen-256color" set-option -g terminal-overrides 'xterm*:smcup@:rmcup@' set-option -s escape-time 0 +if-shell 'test `tput colors` -eq 256' 'set-option -g default-terminal "screen-256color"' # Titles set-window-option -g automatic-rename off -- cgit v1.2.3