From 158cd6b679db1d4fead69e80be66c470615b84ae Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Fri, 23 Jan 2015 01:26:46 +0900 Subject: [PATCH 1/6] Makefile: Add target setup-tmux, still do nothing --- Makefile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b23fb58..3b02ed1 100644 --- a/Makefile +++ b/Makefile @@ -35,7 +35,7 @@ test_syntaxes = test-syntax-el test-syntax-sh test-syntax: $(test_syntaxes) setups = setup-darwin setup-directories setup-emacs setup-gitconf \ - setup-repository setup-util + setup-repository setup-util setup-tmux setup: $(setups) @@ -215,6 +215,13 @@ endif +# tmux setup +# ---------- + +setup-tmux: + + + # test From 519e885a502c3f0c305b24020b272b48934812b4 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Fri, 23 Jan 2015 01:38:30 +0900 Subject: [PATCH 2/6] A --- profile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/profile b/profile index 5190ced..b3211d8 100755 --- a/profile +++ b/profile @@ -112,3 +112,9 @@ then export CHIT_PATH="$HOME/dbx/.chit" fi + +########################################### +# Host colors + +export _COLOR_FOREGROUND= +export _COLOR_BACKGROUND= 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 3/6] 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 From 46b13454f8087aea4e48450e28fd0d4bc09a54dd Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Fri, 23 Jan 2015 12:43:07 +0900 Subject: [PATCH 4/6] Fix color variable names --- shrc | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/shrc b/shrc index b6d9f09..a86fe50 100755 --- a/shrc +++ b/shrc @@ -1072,29 +1072,29 @@ then __color_black="${__attr_beg}0;30${__attr_end}" __color_red="${__attr_beg}0;31${__attr_end}" __color_green="${__attr_beg}0;32${__attr_end}" - __color_brown="${__attr_beg}0;33${__attr_end}" + __color_yellow="${__attr_beg}0;33${__attr_end}" __color_blue="${__attr_beg}0;34${__attr_end}" - __color_purple="${__attr_beg}0;35${__attr_end}" + __color_magenta="${__attr_beg}0;35${__attr_end}" __color_cyan="${__attr_beg}0;36${__attr_end}" - __color_light_gray="${__attr_beg}0;37${__attr_end}" + __color_white="${__attr_beg}0;37${__attr_end}" - __color_dark_gray="${__attr_beg}1;30${__attr_end}" + __color_light_black="${__attr_beg}1;30${__attr_end}" __color_light_red="${__attr_beg}1;31${__attr_end}" __color_light_green="${__attr_beg}1;32${__attr_end}" - __color_yellow="${__attr_beg}1;33${__attr_end}" + __color_light_yellow="${__attr_beg}1;33${__attr_end}" __color_light_blue="${__attr_beg}1;34${__attr_end}" - __color_light_purple="${__attr_beg}1;35${__attr_end}" + __color_light_magenta="${__attr_beg}1;35${__attr_end}" __color_light_cyan="${__attr_beg}1;36${__attr_end}" - __color_white="${__attr_beg}1;37${__attr_end}" + __color_light_white="${__attr_beg}1;37${__attr_end}" __color_bg_black="${__attr_beg}40${__attr_end}" __color_bg_red="${__attr_beg}41${__attr_end}" __color_bg_green="${__attr_beg}42${__attr_end}" - __color_bg_brown="${__attr_beg}43${__attr_end}" + __color_bg_yellow="${__attr_beg}43${__attr_end}" __color_bg_blue="${__attr_beg}44${__attr_end}" - __color_bg_purple="${__attr_beg}45${__attr_end}" + __color_bg_magenta="${__attr_beg}45${__attr_end}" __color_bg_cyan="${__attr_beg}46${__attr_end}" - __color_bg_light_gray="${__attr_beg}47${__attr_end}" + __color_bg_white="${__attr_beg}47${__attr_end}" __attr_underline="${__attr_beg}4${__attr_end}" __attr_reverse="${__attr_beg}7${__attr_end}" @@ -1113,7 +1113,7 @@ then # color for :: case "`hostname`" in arch-aspireone) - __my_c4="$__color_yellow" + __my_c4="$__color_light_yellow" ;; arch-mba) __my_c4="$__color_light_cyan" @@ -1128,7 +1128,7 @@ then __my_c4="$__color_light_green" ;; esac - __my_c5="$__color_black$__color_bg_light_gray" # color for SCR + __my_c5="$__color_black$__color_bg_white" # color for SCR __my_cdef="$__color_default" fi From 4b6070a8005f7ba7455371777287b3b48968405f Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Fri, 23 Jan 2015 12:50:28 +0900 Subject: [PATCH 5/6] shrc: Decide prompt color from _HOSTCOLOR_1 --- shrc | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/shrc b/shrc index a86fe50..f1d5b28 100755 --- a/shrc +++ b/shrc @@ -1111,23 +1111,7 @@ then __my_c1="$__attr_bold$__attr_underline" # color for PWD __my_c2="$__attr_bold$__attr_underline" # color for user and hostname # color for :: - case "`hostname`" in - arch-aspireone) - __my_c4="$__color_light_yellow" - ;; - arch-mba) - __my_c4="$__color_light_cyan" - ;; - newkiwi) - __my_c4="$__color_light_purple" - ;; - debian-vb-win7-opti) - __my_c4="$__color_light_red" - ;; - *) - __my_c4="$__color_light_green" - ;; - esac + eval "__my_c4=\${__color_light_${_HOSTCOLOR_1}}" __my_c5="$__color_black$__color_bg_white" # color for SCR __my_cdef="$__color_default" fi From a342673e4a6727ed4287e77395f24e109b1fa40c Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Fri, 23 Jan 2015 13:28:07 +0900 Subject: [PATCH 6/6] Add colour names as comment --- profile | 1 + 1 file changed, 1 insertion(+) diff --git a/profile b/profile index 447efa4..746534d 100755 --- a/profile +++ b/profile @@ -118,6 +118,7 @@ fi export _HOSTCOLOR_1= export _HOSTCOLOR_2= +# black red green yellow blue magenta cyan white case "`hostname`" in arch-aspireone) _HOSTCOLOR_1=yellow