From efee33952578138ef28e7c944699fcabaf4c7b8b Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Fri, 23 Jan 2015 12:30:07 +0900 Subject: [PATCH] Set _HOSTCOLOR_ env val and use it from tmux.conf --- profile | 26 ++++++++++++++++++++++++-- tmux.conf | 9 +++++++-- 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/profile b/profile index b3211d8..447efa4 100755 --- a/profile +++ b/profile @@ -116,5 +116,27 @@ fi ########################################### # Host colors -export _COLOR_FOREGROUND= -export _COLOR_BACKGROUND= +export _HOSTCOLOR_1= +export _HOSTCOLOR_2= +case "`hostname`" in + arch-aspireone) + _HOSTCOLOR_1=yellow + _HOSTCOLOR_2=black + ;; + arch-mba) + _HOSTCOLOR_1=cyan + _HOSTCOLOR_2=black + ;; + newkiwi) + _HOSTCOLOR_1=magenta + _HOSTCOLOR_2=white + ;; + debian-vb-win7-opti) + _HOSTCOLOR_1=red + _HOSTCOLOR_2=white + ;; + *) + _HOSTCOLOR_1=green + _HOSTCOLOR_2=black + ;; +esac diff --git a/tmux.conf b/tmux.conf index ae4c6f0..fcd9add 100644 --- a/tmux.conf +++ b/tmux.conf @@ -1,7 +1,12 @@ # tmux.conf -if "test -f $HOME/.tmux.conf.local" "source-file $HOME/.tmux.conf.local" \ - "display-message \"$HOME/.tmux.conf.local not found\"" +run-shell 'tmux set -g status-right "${USER}@`hostname` | #(tmux -V) "' + +run-shell 'tmux set -g status-bg "$_HOSTCOLOR_1" >/dev/null' +run-shell 'tmux set -g status-fg "$_HOSTCOLOR_2" >/dev/null' +run-shell 'tmux set -g mode-bg "$_HOSTCOLOR_1" >/dev/null' +run-shell 'tmux set -g mode-bg "$_HOSTCOLOR_2" >/dev/null' +run-shell 'tmux set -g pane-active-border-fg "$_HOSTCOLOR_1" >/dev/null' unbind C-b set -g prefix C-z