Skip to content

Commit 17a1b18

Browse files
committed
Add synchronize-panes indication
This change updates the themes so that when the synchronize-panes option is active the current window status primary background color changes to red and, if there are multiple panes, the active pane border color also changes to red. There doesn't seem to be a need to indicate the synchronize-panes status for non-active windows, since the status will become apparent when the window is made active again.
1 parent aeb30c7 commit 17a1b18

File tree

3 files changed

+21
-6
lines changed

3 files changed

+21
-6
lines changed

src/theme_gruvbox_dark.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ theme_set_dark() {
1212
_right_status_z=$4
1313
_statusbar_alpha=$5
1414

15+
# Color to use to indicate that synchronize-panes is enabled
16+
local _sync_color=${col_red2}
17+
1518
tmux_append_seto "status" "on"
1619

1720
# default statusbar bg color
@@ -33,7 +36,7 @@ theme_set_dark() {
3336
tmux_append_setwo "window-status-current-style" "bg=${_active_window_title_bg},fg=${col_bg1}" # TODO cosider removing red!
3437

3538
# pane border
36-
tmux_append_seto "pane-active-border-style" "fg=${col_fg2}"
39+
tmux_append_seto "pane-active-border-style" "#{?pane_synchronized,fg=${_sync_color},fg=${col_fg2}}"
3740
tmux_append_seto "pane-border-style" "fg=${col_bg1}"
3841

3942
# message infos
@@ -69,8 +72,10 @@ theme_set_dark() {
6972

7073
# current window
7174
local _current_window_status_format_bg=${col_bg1}
75+
local _current_window_status_primary_bg="#{?pane_synchronized,bg=${_sync_color},bg=${col_yellow2}}"
76+
local _current_window_status_primary_fg="#{?pane_synchronized,fg=${_sync_color},fg=${col_yellow2}}"
7277
if [[ "$_statusbar_alpha" == "true" ]]; then _current_window_status_format_bg="default"; fi
73-
tmux_append_setwo "window-status-current-format" "#[bg=${col_yellow2},fg=${col_bg1},nobold,noitalics,nounderscore]#[bg=${col_yellow2},fg=${col_bg2}] #I #[bg=${col_yellow2},fg=${col_bg2},bold] #W#{?window_zoomed_flag,*Z,} #{?window_end_flag,#[bg=${_current_window_status_format_bg}],#[bg=${col_bg1}]}#[fg=${col_yellow2},nobold,noitalics,nounderscore]"
78+
tmux_append_setwo "window-status-current-format" "#[${_current_window_status_primary_bg},fg=${col_bg1},nobold,noitalics,nounderscore]#[${_current_window_status_primary_bg},fg=${col_bg2}] #I #[${_current_window_status_primary_bg},fg=${col_bg2},bold] #W#{?window_zoomed_flag,*Z,} #{?window_end_flag,#[bg=${_current_window_status_format_bg}],#[bg=${col_bg1}]}#[${_current_window_status_primary_fg},nobold,noitalics,nounderscore]"
7479

7580
# default window
7681
local _default_window_status_format_bg=${col_bg1}

src/theme_gruvbox_light.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ theme_set_light() {
1212
_right_status_z=$4
1313
_statusbar_alpha=$5
1414

15+
# Color to use to indicate that synchronize-panes is enabled
16+
local _sync_color=${col_red}
17+
1518
tmux_append_seto "status" "on"
1619

1720
# default statusbar bg color
@@ -33,7 +36,7 @@ theme_set_light() {
3336
tmux_append_setwo "window-status-current-style" "bg=${_active_window_title_bg},fg=${col_bg1}" # TODO cosider removing red!
3437

3538
# pane border
36-
tmux_append_seto "pane-active-border-style" "fg=${col_fg2}"
39+
tmux_append_seto "pane-active-border-style" "#{?pane_synchronized,fg=${_sync_color},fg=${col_fg2}}"
3740
tmux_append_seto "pane-border-style" "fg=${col_bg1}"
3841

3942
# message infos
@@ -69,8 +72,10 @@ theme_set_light() {
6972

7073
# current window
7174
local _current_window_status_format_bg=${col_bg1}
75+
local _current_window_status_primary_bg="#{?pane_synchronized,bg=${_sync_color},bg=${col_yellow2}}"
76+
local _current_window_status_primary_fg="#{?pane_synchronized,fg=${_sync_color},fg=${col_yellow2}}"
7277
if [[ "$_statusbar_alpha" == "true" ]]; then _current_window_status_format_bg="default"; fi
73-
tmux_append_setwo "window-status-current-format" "#[bg=${col_yellow2},fg=${col_bg1},nobold,noitalics,nounderscore]#[bg=${col_yellow2},fg=${col_bg2}] #I #[bg=${col_yellow2},fg=${col_bg2},bold] #W#{?window_zoomed_flag,*Z,} #{?window_end_flag,#[bg=${_current_window_status_format_bg}],#[bg=${col_bg1}]}#[fg=${col_yellow2},nobold,noitalics,nounderscore]"
78+
tmux_append_setwo "window-status-current-format" "#[${_current_window_status_primary_bg},fg=${col_bg1},nobold,noitalics,nounderscore]#[${_current_window_status_primary_bg},fg=${col_bg2}] #I #[${_current_window_status_primary_bg},fg=${col_bg2},bold] #W#{?window_zoomed_flag,*Z,} #{?window_end_flag,#[bg=${_current_window_status_format_bg}],#[bg=${col_bg1}]}#[${_current_window_status_primary_fg},nobold,noitalics,nounderscore]"
7479

7580
# default window
7681
local _default_window_status_format_bg=${col_bg1}

src/theme_gruvbox_light256.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ theme_set_light256() {
1212
_right_status_z=$4
1313
_statusbar_alpha=$5
1414

15+
# Color to use to indicate that synchronize-panes is enabled
16+
local _sync_color=${col_red}
17+
1518
tmux_append_seto "status" "on"
1619

1720
# default statusbar bg color
@@ -33,7 +36,7 @@ theme_set_light256() {
3336
tmux_append_setwo "window-status-current-style" "bg=${_active_window_title_bg},fg=${col_bg1}" # TODO cosider removing red!
3437

3538
# pane border
36-
tmux_append_seto "pane-active-border-style" "fg=${col_fg2}"
39+
tmux_append_seto "pane-active-border-style" "#{?pane_synchronized,fg=${_sync_color},fg=${col_fg2}}"
3740
tmux_append_seto "pane-border-style" "fg=${col_bg1}"
3841

3942
# message infos
@@ -69,8 +72,10 @@ theme_set_light256() {
6972

7073
# current window
7174
local _current_window_status_format_bg=${col_bg2}
75+
local _current_window_status_primary_bg="#{?pane_synchronized,bg=${_sync_color},bg=${col_yellow}}"
76+
local _current_window_status_primary_fg="#{?pane_synchronized,fg=${_sync_color},fg=${col_yellow}}"
7277
if [[ "$_statusbar_alpha" == "true" ]]; then _current_window_status_format_bg="default"; fi
73-
tmux_append_setwo "window-status-current-format" "#[bg=${col_yellow},fg=${col_bg2},nobold,noitalics,nounderscore]#[bg=${col_yellow},fg=${col_fg1}] #I #[bg=${col_yellow},fg=${col_fg1},bold] #W#{?window_zoomed_flag,*Z,} #{?window_end_flag,#[bg=${_current_window_status_format_bg}],#[bg=${col_bg2}]}#[fg=${col_yellow},nobold,noitalics,nounderscore]"
78+
tmux_append_setwo "window-status-current-format" "#[${_current_window_status_primary_bg},fg=${col_bg2},nobold,noitalics,nounderscore]#[${_current_window_status_primary_bg},fg=${col_fg1}] #I #[${_current_window_status_primary_bg},fg=${col_fg1},bold] #W#{?window_zoomed_flag,*Z,} #{?window_end_flag,#[bg=${_current_window_status_format_bg}],#[bg=${col_bg2}]}#[${_current_window_status_primary_fg},nobold,noitalics,nounderscore]"
7479

7580
# default window
7681
local _default_window_status_format_bg=${col_bg2}

0 commit comments

Comments
 (0)