Skip to content

Commit

Permalink
feat(status): Add support for status module middle separators (#310)
Browse files Browse the repository at this point in the history
* added middle separator for status

* fixed color + updated readme

* Update README.md

Co-authored-by: vdbe <44153531+vdbe@users.noreply.github.com>

---------

Co-authored-by: vdbe <44153531+vdbe@users.noreply.github.com>
  • Loading branch information
sebaraj and vdbe authored Sep 17, 2024
1 parent c43c10f commit 1612a23
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,12 @@ tmux kill-server & tmux
set -g @catppuccin_status_left_separator ""
```

#### Set the status module middle separator:

```sh
set -g @catppuccin_status_middle_separator "null"
```

#### Set the status module right separator:
```sh
set -g @catppuccin_status_right_separator ""
Expand Down
3 changes: 2 additions & 1 deletion builder/module_builder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ build_status_module() {
fi

local show_left_separator="#[fg=$color,bg=$bg,nobold,nounderscore,noitalics]$status_left_separator"
local show_middle_separator="#[fg=$color,bg=$thm_gray,nobold,nounderscore,noitalics]$status_middle_separator"
local show_right_separator="#[fg=$thm_gray,bg=$bg,nobold,nounderscore,noitalics]$status_right_separator"
fi

Expand All @@ -44,5 +45,5 @@ build_status_module() {
show_icon=""
fi

echo "$show_left_separator$show_icon$show_text$show_right_separator"
echo "$show_left_separator$show_icon$show_middle_separator$show_text$show_right_separator"
}
4 changes: 3 additions & 1 deletion catppuccin.tmux
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ main() {
add_tmux_batch_option "@catppuccin_window_number_position"
add_tmux_batch_option "@catppuccin_window_status"
add_tmux_batch_option "@catppuccin_status_left_separator"
add_tmux_batch_option "@catppuccin_status_middle_separator"
add_tmux_batch_option "@catppuccin_status_right_separator"
add_tmux_batch_option "@catppuccin_status_connect_separator"
add_tmux_batch_option "@catppuccin_status_fill"
Expand Down Expand Up @@ -196,10 +197,11 @@ main() {
setw window-status-current-format "$(do_color_interpolation "$window_current_format")"

# status module
local status_left_separator status_right_separator status_connect_separator \
local status_left_separator status_middle_separator status_right_separator status_connect_separator \
status_fill status_modules_left status_modules_right
status_left_separator=$(get_tmux_batch_option "@catppuccin_status_left_separator" "")
status_right_separator=$(get_tmux_batch_option "@catppuccin_status_right_separator" "")
status_middle_separator=$(get_tmux_batch_option "@catppuccin_status_middle_separator" "")
status_connect_separator=$(get_tmux_batch_option "@catppuccin_status_connect_separator" "yes")
status_fill=$(get_tmux_batch_option "@catppuccin_status_fill" "icon")

Expand Down

0 comments on commit 1612a23

Please sign in to comment.