aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDeterminant <tederminant@gmail.com>2020-05-22 17:15:40 -0400
committerDeterminant <tederminant@gmail.com>2020-05-22 17:15:40 -0400
commit50a0fbab85a87188857ca8f9516dc3a36722a3cb (patch)
tree2c1ac3760d3db59198dcbb4034f0b1f08f982954
parent268f4a0cdc4386648ad77c175ffb007135f7d33c (diff)
clean up color names and add help info
-rw-r--r--README.rst12
-rwxr-xr-xtmux-colortag-prompt.sh11
-rwxr-xr-xtmux-colortag.tmux52
3 files changed, 43 insertions, 32 deletions
diff --git a/README.rst b/README.rst
index 98f1dba..f738fc0 100644
--- a/README.rst
+++ b/README.rst
@@ -58,13 +58,17 @@ Installation
- To immediately play with the main feature, try ``prefix`` (``Ctrl+b`` by default) + ``,`` and change the window name.
- NOTE: tmux won't change the window name automatically once you set it manually. To test the auto-changing color, just run any command in your new window.
+Help
+====
+Press ``prefix``, then ``C``, type ``help`` and press enter.
+
Customization
=============
-- To manually set the color of the active window tag, press ``prefix`` + C and:
+- To manually set the color of the active window tag, press ``prefix`` + ``C`` and:
- - ``color-idx <256 color code>`` to manually set the color for the window index
- - ``color-name <256 color code>`` to manually set the color for the name
+ - ``color-idx <0-255 color code>`` to manually set the color for the window index
+ - ``color-name <0-255 color code>`` to manually set the color for the name
- ``clear-idx`` clears the preivous color of the index
- ``clear-name`` clears the preivous color of the name
- ``clear-all`` use auto-coloring for all window tags
@@ -82,7 +86,7 @@ Customization
TMUX_COLORTAG_USE_POWERLINE=yes
-- To change the prompt key (``prefix`` + C), specify your key in ``TMUX_COLORTAG_KEY``.
+- To change the prompt key (``prefix`` + ``C``), specify your key in ``TMUX_COLORTAG_KEY``.
- If you don't like the existing powerline symbols, feel free to change them by
specifying the following environment variables to override the default:
diff --git a/tmux-colortag-prompt.sh b/tmux-colortag-prompt.sh
index 7b09857..874a29f 100755
--- a/tmux-colortag-prompt.sh
+++ b/tmux-colortag-prompt.sh
@@ -27,5 +27,16 @@ case "$1" in
clear-all)
run_python --clear
;;
+ '') ;;
+ help)
+ echo "# Tmux ColorTag"
+ echo "# Ted Yin <tederminant@gmail.com>"
+ echo "Note: color overriding order: color-idx > color-name > auto"
+ echo "color-idx <0-255>: manually set the color for the window index"
+ echo "color-name <0-255>: manually set the color for the name"
+ echo "clear-idx: clears the preivous color of the index"
+ echo "clear-name: clears the preivous color of the name"
+ echo "clear-all: use auto-coloring for all window tags"
+ ;;
*) tmux display "ColorTag: invalid command"; exit 0;;
esac
diff --git a/tmux-colortag.tmux b/tmux-colortag.tmux
index 0e4c9e4..9bcb190 100755
--- a/tmux-colortag.tmux
+++ b/tmux-colortag.tmux
@@ -11,44 +11,40 @@ if [[ "$TMUX_COLORTAG_SET_INTERVAL" == yes ]]; then
tmux set -g status-interval 2
fi
-color0=colour237
-color1=colour239
-color2=colour255
-color3=colour246
-color4=colour248
-color5=colour241
-color6=colour240
-color7=colour236
-color8=colour235
+bg0=colour235
+bg1=colour237
+white0=colour255
+lightgray=colour248
+darkgray=colour241
if [[ "$TMUX_COLORTAG_TAG_ONLY" != yes ]]; then
- tmux set -g message-style fg=$color0,bg=$color4
- tmux set -g message-command-style fg=$color0,bg=$color4
- tmux set -g pane-active-border-style fg=$color6,bg=$color8
- tmux set -g pane-border-style fg=$color7,bg=$color8
- tmux set -g window-style bg=$color8
+ tmux set -g message-style fg=$bg1,bg=$lightgray
+ tmux set -g message-command-style fg=$bg1,bg=$lightgray
+ tmux set -g pane-active-border-style fg=$darkgray,bg=$bg0
+ tmux set -g pane-border-style fg=$bg1,bg=$bg0
+ tmux set -g window-style bg=$bg0
fi
-tmux set -g status-style bg=$color0
+tmux set -g status-style bg=$bg1
tmux set -g window-status-separator ""
-tmux set -g window-status-style fg=$color0,bg=$color0,none
-tmux set -g window-status-activity-style bg=$color0,fg=$color4,none
-tmux set -g window-status-bell-style bg=$color0,fg=$color4,none
+tmux set -g window-status-style fg=$bg1,bg=$bg1,none
+tmux set -g window-status-activity-style bg=$bg1,fg=$lightgray,none
+tmux set -g window-status-bell-style bg=$bg1,fg=$lightgray,none
-RECOVER_BG="#[bg=$color0]"
+RECOVER_BG="#[bg=$bg1]"
LEFTBAR_FORMAT="$(printf "%s" \
- "#{?client_prefix,#[fg=$color5]#[bg=$color4],#[fg=$color4]#[bg=$color5]} " \
- "#S#{?client_prefix,#[fg=$color4],#[fg=$color5]}")"
-RIGHTBAR_DEFAULT="#[fg=$color3,bg=$color1]"
-RIGHTBAR_DEFAULT0="#[fg=$color1,bg=$color0]"
-RIGHTBAR_HOST="#[fg=$color0,bg=$color4]"
-RIGHTBAR_HOST0="#[fg=$color4,bg=$color1]"
+ "#{?client_prefix,#[fg=$darkgray]#[bg=$lightgray],#[fg=$lightgray]#[bg=$darkgray]} " \
+ "#S#{?client_prefix,#[fg=$lightgray],#[fg=$darkgray]}")"
+RIGHTBAR_DEFAULT="#[fg=$lightgray,bg=$darkgray]"
+RIGHTBAR_DEFAULT0="#[fg=$darkgray,bg=$bg1]"
+RIGHTBAR_HOST="#[fg=$bg1,bg=$lightgray]"
+RIGHTBAR_HOST0="#[fg=$lightgray,bg=$darkgray]"
LOAD_DISP="#(awk '{print \$1, \$2, \$3}' /proc/loadavg)"
TAB_COLOR="#(\"$CURRENT_DIR/name2color.py\" #S #I #W)"
-TAB_NORMAL_BEGIN="#[fg=$color0,bg=$TAB_COLOR]"
-TAB_END="#[fg=$TAB_COLOR,bg=$color0]"
+TAB_NORMAL_BEGIN="#[fg=$bg1,bg=$TAB_COLOR]"
+TAB_END="#[fg=$TAB_COLOR,bg=$bg1]"
TAB_FOCUS_BEGIN_BG="#[bg=$TAB_COLOR]"
-TAB_FOCUS_BEGIN_FG="#[fg=$color2]"
+TAB_FOCUS_BEGIN_FG="#[fg=$white0]"
TAB_FOCUS_BEGIN="${TAB_FOCUS_BEGIN_BG}${TAB_FOCUS_BEGIN_FG}"
if [[ "$TMUX_COLORTAG_USE_POWERLINE" == no ]]; then