Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(status): Add support for status module middle separators #310

Merged
merged 4 commits into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,12 @@ tmux kill-server & tmux
set -g @catppuccin_status_left_separator ""
```

#### Set the status module middle separator:

```sh
set -g @catppuccin_status_middle_separator ""
sebaraj marked this conversation as resolved.
Show resolved Hide resolved
```

#### 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