aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDeterminant <tederminant@gmail.com>2020-05-20 20:43:09 -0400
committerDeterminant <tederminant@gmail.com>2020-05-20 20:43:09 -0400
commitecc4b13bcd45615ebde535745f832285227111d6 (patch)
tree7672a98ae0455409132a8f0d3081e7f7b7fcf6a2
parentc60ce9477863f4608deb294fb63604b7e5a52bb2 (diff)
allow customizing the separator
-rw-r--r--README.rst11
-rwxr-xr-xtmux-colortag.tmux10
2 files changed, 14 insertions, 7 deletions
diff --git a/README.rst b/README.rst
index 47f6e48..47a9c05 100644
--- a/README.rst
+++ b/README.rst
@@ -48,11 +48,14 @@ 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.
-- Optional: for the best experience, this plugin assumes a short status update
+Customization
+=============
+
+- For the best experience, this plugin assumes a short status update
interval. To change it back, specify ``TMUX_COLORTAG_SET_INTERVAL=no`` or
directly override the setting in your tmux config file.
-- Optional: if you don't like powerline symbols, feel free to change them by
+- If you don't like powerline symbols, feel free to change them by
specifying the following environment variables to override the default:
- ``TMUX_ARROW_SYMBOL_L1``
@@ -60,9 +63,11 @@ Installation
- ``TMUX_ARROW_SYMBOL_R1``
- ``TMUX_ARROW_SYMBOL_R2``
-- Optional: if you only want to color the tags (without changing other styles
+- If you only want to color the tags (without changing other styles
such as borders), specify ``TMUX_COLORTAG_TAG_ONLY=yes``.
+- ``TMUX_COLORTAG_IDX_SEP`` controls the separator between the window index and name.
+
Update to the Latest Version
============================
diff --git a/tmux-colortag.tmux b/tmux-colortag.tmux
index d05f739..b937ac1 100755
--- a/tmux-colortag.tmux
+++ b/tmux-colortag.tmux
@@ -51,15 +51,17 @@ TAB_FOCUS_BEGIN_FG="#[fg=$color2]"
TAB_FOCUS_BEGIN="${TAB_FOCUS_BEGIN_BG}${TAB_FOCUS_BEGIN_FG}"
if [[ "$TMUX_COLORTAG_NOPOWERLINE" == yes ]]; then
+ TMUX_COLORTAG_IDX_SEP="${TMUX_COLORTAG_IDX_SEP:-|}"
tmux set -g status-left "${LEFTBAR_FORMAT} ${RECOVER_BG} "
tmux set -g status-right "${RIGHTBAR_DEFAULT} ${LOAD_DISP} ${RIGHTBAR_HOST} #h "
- tmux set -g window-status-format "${TAB_NORMAL_BEGIN} #I|#W ${TAB_END} "
- tmux set -g window-status-current-format "${TAB_FOCUS_BEGIN} #I|#W ${TAB_END} "
+ tmux set -g window-status-format "${TAB_NORMAL_BEGIN} #I${TMUX_COLORTAG_IDX_SEP}#W ${TAB_END} "
+ tmux set -g window-status-current-format "${TAB_FOCUS_BEGIN} #I${TMUX_COLORTAG_IDX_SEP}#W ${TAB_END} "
else
TMUX_ARROW_SYMBOL_L1="${TMUX_ARROW_SYMBOL_L1:-$(printf '\ue0b6')}"
TMUX_ARROW_SYMBOL_L2="${TMUX_ARROW_SYMBOL_L2:-$(printf '\ue0b7')}"
TMUX_ARROW_SYMBOL_R1="${TMUX_ARROW_SYMBOL_R1:-$(printf '\ue0b4')}"
TMUX_ARROW_SYMBOL_R2="${TMUX_ARROW_SYMBOL_R2:-$(printf '\ue0b5')}"
+ TMUX_COLORTAG_IDX_SEP="${TMUX_COLORTAG_IDX_SEP:-$TMUX_ARROW_SYMBOL_R2}"
tmux set -g status-left "${LEFTBAR_FORMAT}${RECOVER_BG}${TMUX_ARROW_SYMBOL_R1} "
tmux set -g status-right "$(printf %s \
@@ -69,8 +71,8 @@ else
"${RIGHTBAR_HOST}#h ")"
tmux set -g window-status-format "$(printf %s \
"${TAB_NORMAL_BEGIN}$TMUX_ARROW_SYMBOL_R1 " \
- "#I$TMUX_ARROW_SYMBOL_R2#W${TAB_END}$TMUX_ARROW_SYMBOL_R1 ")"
+ "#I${TMUX_COLORTAG_IDX_SEP}#W${TAB_END}$TMUX_ARROW_SYMBOL_R1 ")"
tmux set -g window-status-current-format "$(printf %s \
"${TAB_FOCUS_BEGIN_BG}$TMUX_ARROW_SYMBOL_R1 " \
- "${TAB_FOCUS_BEGIN_FG}#I$TMUX_ARROW_SYMBOL_R2#W${TAB_END}$TMUX_ARROW_SYMBOL_R1 ")"
+ "${TAB_FOCUS_BEGIN_FG}#I${TMUX_COLORTAG_IDX_SEP}#W${TAB_END}$TMUX_ARROW_SYMBOL_R1 ")"
fi