Skip to content

Commit 1b69e8a

Browse files
committed
Add auto-hide feature to synchronize-panes plugin via @dracula-synchronize-panes-auto-hide
This allows the user to hide the Sync label (`@dracula-synchronize-panes-label`) from the status bar when sync is in the `off` state
1 parent 6000e2a commit 1b69e8a

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

scripts/synchronize_panes.sh

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,19 @@ main()
1616
{
1717
# storing the refresh rate in the variable RATE, default is 5
1818
RATE=$(get_tmux_option "@dracula-refresh-rate" 5)
19-
synchronize_panes_label=$label
19+
20+
synchronize_panes_auto_hide=$(get_tmux_option "@dracula-synchronize-panes-auto-hide" "false")
2021
synchronize_panes_status=$(get_synchronize_panes_status)
21-
echo "$synchronize_panes_label $synchronize_panes_status"
22+
synchronize_panes_label=$label
23+
24+
if [[ "$synchronize_panes_auto_hide" == 'true' ]]; then
25+
if [[ "$synchronize_panes_status" == 'on' ]]; then
26+
echo "$synchronize_panes_label"
27+
fi
28+
else
29+
echo "$synchronize_panes_label $synchronize_panes_status"
30+
fi
31+
2232
sleep $RATE
2333
}
2434

0 commit comments

Comments
 (0)