aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDeterminant <tederminant@gmail.com>2020-05-23 14:11:32 -0400
committerDeterminant <tederminant@gmail.com>2020-05-23 14:11:32 -0400
commit9bf75d0dfe375222eae2b1979f194be93e49d0b1 (patch)
treea0c2cdbcb4743c4c69dac66e0606fd2b97e544c8
parent8f8792508e7d1e7f34d279692da22c17d1607913 (diff)
add more customizable features
-rw-r--r--README.rst3
-rwxr-xr-xtmux-colortag.tmux24
2 files changed, 24 insertions, 3 deletions
diff --git a/README.rst b/README.rst
index 4e42677..575000e 100644
--- a/README.rst
+++ b/README.rst
@@ -92,6 +92,9 @@ Customization
- Other tweakable variables:
+ - ``TMUX_COLORTAG_TAG_BOLD``: specify ``yes`` if you want bold tag text
+ - ``TMUX_COLORTAG_TAG_FOCUS_HIGHLIGHT``: specify ``yes`` if you want highlighted text for the active tag
+ - ``TMUX_COLORTAG_TAG_FOCUS_UNDERLINE``: specify ``yes`` if you want underlined text for the active tag
- ``TMUX_ARROW_SYMBOL_L1``
- ``TMUX_ARROW_SYMBOL_L2``
- ``TMUX_ARROW_SYMBOL_R1``
diff --git a/tmux-colortag.tmux b/tmux-colortag.tmux
index 747c621..b24d809 100755
--- a/tmux-colortag.tmux
+++ b/tmux-colortag.tmux
@@ -5,12 +5,24 @@ TMUX_COLORTAG_SET_INTERVAL="${TMUX_COLORTAG_SET_INTERVAL:-yes}"
TMUX_COLORTAG_TAG_ONLY="${TMUX_COLORTAG_TAG_ONLY:-no}"
TMUX_COLORTAG_USE_POWERLINE="${TMUX_COLORTAG_USE_POWERLINE:-no}"
TMUX_COLORTAG_KEY="${TMUX_COLORTAG_KEY:-C}"
+TMUX_COLORTAG_TAG_BOLD="${TMUX_COLORTAG_TAG_BOLD:-no}"
+TMUX_COLORTAG_TAG_FOCUS_HIGHLIGHT="${TMUX_COLORTAG_TAG_FOCUS_HIGHLIGHT:-yes}"
+TMUX_COLORTAG_TAG_FOCUS_UNDERLINE="${TMUX_COLORTAG_TAG_FOCUS_UNDERLINE:-yes}"
if [[ "$TMUX_COLORTAG_SET_INTERVAL" == yes ]]; then
tmux set -g status on
tmux set -g status-interval 2
fi
+tab_text_attr=
+if [[ "$TMUX_COLORTAG_TAG_BOLD" == yes ]]; then
+ tab_text_attr+=",bold"
+fi
+focus_tab_text_attr="$tab_text_attr"
+if [[ "$TMUX_COLORTAG_TAG_FOCUS_UNDERLINE" == yes ]]; then
+ focus_tab_text_attr+=",underscore"
+fi
+
bg0=${colortag_bg0:-colour235}
bg1=${colortag_bg1:-colour237}
white0=${colortag_white0:-colour255}
@@ -18,12 +30,17 @@ white1=${colortag_white1:-colour250}
lightgray=${colortag_lightgray:-colour248}
darkgray=${colortag_darkgray:-colour241}
+if [[ "$TMUX_COLORTAG_TAG_FOCUS_HIGHLIGHT" == yes ]]; then
+ tab_focus_fg="$white0"
+fi
+
if [[ "$TMUX_COLORTAG_TAG_ONLY" != yes ]]; then
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=$white1,bg=$bg0
tmux set -g pane-border-style fg=$bg1,bg=$bg0
tmux set -g window-style bg=$bg0
+ tmux set -g mode-style fg=$bg1,bg=$white1
fi
tmux set -g status-style bg=$bg1
@@ -42,10 +59,11 @@ 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=$bg1,bg=$TAB_COLOR]"
+TAB_NORMAL_BEGIN="#[fg=$bg1,bg=${TAB_COLOR}$tab_text_attr]"
TAB_END="#[fg=$TAB_COLOR,bg=$bg1]"
TAB_FOCUS_BEGIN_BG="#[bg=$TAB_COLOR]"
-TAB_FOCUS_BEGIN_FG="#[fg=$white0]"
+TAB_FOCUS_BEGIN_FG="#[fg=$tab_focus_fg$focus_tab_text_attr]"
+TAB_FOCUS_PREEND_FG="#[fg=$tab_focus_fg,none]"
TAB_FOCUS_BEGIN="${TAB_FOCUS_BEGIN_BG}${TAB_FOCUS_BEGIN_FG}"
if [[ "$TMUX_COLORTAG_USE_POWERLINE" == no ]]; then
@@ -76,7 +94,7 @@ else
"#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_COLORTAG_IDX_SEP}#W${TAB_END}$TMUX_ARROW_SYMBOL_R1 ")"
+ "${TAB_FOCUS_BEGIN_FG}#I${TMUX_COLORTAG_IDX_SEP}#W${TAB_FOCUS_PREEND_FG}${TAB_END}$TMUX_ARROW_SYMBOL_R1 ")"
fi
tmux bind-key "$TMUX_COLORTAG_KEY" run-shell "'$CURRENT_DIR/tmux-colortag-prompt.sh' prompt"