Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions docs/CONFIG.md
Original file line number Diff line number Diff line change
Expand Up @@ -802,15 +802,34 @@ nerdfont icons to consider:

### synchronize-panes - [up](#table-of-contents)

This widget displays whether the tmux panes are currently synchronised or not.
This widget displays whether the tmux panes are currently synchronised.

To change the label:

```bash
set -g @dracula-synchronize-panes-label "Sync"
```

`set -g @dracula-refresh-rate 5` affects this widget
The global refresh rate affects this widget:

```bash
set -g @dracula-refresh-rate 5
```

You can set a custom refresh rate just for synchronize-panes:

```bash
set -g @dracula-synchronize-panes-refresh-rate "0.5" # default: unset
```

**Note:** This only takes precedence for the synchronize-panes widget. This means it won't
override the global `@dracula-refresh-rate`.

Alternatively, you can automatically hide the label when sync is `off`:

```bash
set -g @dracula-synchronize-panes-auto-hide true # default: false
```

### sys-temp - [up](#table-of-contents)

Expand Down
20 changes: 18 additions & 2 deletions scripts/synchronize_panes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,25 @@ main()
{
# storing the refresh rate in the variable RATE, default is 5
RATE=$(get_tmux_option "@dracula-refresh-rate" 5)
synchronize_panes_label=$label

# Use the @dracula-synchronize-panes-refresh-rate plugin variable to override it.
RATE_OVERRIDE=$(get_tmux_option "@dracula-synchronize-panes-refresh-rate" "")
if [[ -n "$RATE_OVERRIDE" ]]; then
RATE="$RATE_OVERRIDE"
fi

synchronize_panes_auto_hide=$(get_tmux_option "@dracula-synchronize-panes-auto-hide" "false")
synchronize_panes_status=$(get_synchronize_panes_status)
echo "$synchronize_panes_label $synchronize_panes_status"
synchronize_panes_label=$label

if [[ "$synchronize_panes_auto_hide" == 'true' ]]; then
if [[ "$synchronize_panes_status" == 'on' ]]; then
echo "$synchronize_panes_label"
fi
else
echo "$synchronize_panes_label $synchronize_panes_status"
fi

sleep $RATE
}

Expand Down