feat(status): window specific separator config (#198)

* feat(window-builder): get window separator based on window type

* feat(window-format): send window type param to builder

fix: apply suggestions from code review

* feat(readme): add window type separator options
This commit is contained in:
Mikel Bravo 2024-09-07 12:03:44 +02:00 committed by GitHub
parent c31b9b2c6c
commit 8276c5a5e3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 21 additions and 2 deletions

View file

@ -9,6 +9,7 @@ build_window_format() {
local background="$3"
local text="$4"
local fill="$5"
local window_type="$6"
# NOTE: For backwards compatibility remove before 1.0.0 and update default for
# `@catppuccin_window_status`
@ -38,6 +39,18 @@ build_window_format() {
text="$text$icon"
fi
if [ "$window_type" = "current" ]; then
add_tmux_batch_option "@catppuccin_window_current_left_separator"
add_tmux_batch_option "@catppuccin_window_current_middle_separator"
add_tmux_batch_option "@catppuccin_window_current_right_separator"
run_tmux_batch_commands
window_left_separator=$(get_tmux_batch_option "@catppuccin_window_current_left_separator" "$window_left_separator")
window_middle_separator=$(get_tmux_batch_option "@catppuccin_window_current_middle_separator" "$window_middle_separator")
window_right_separator=$(get_tmux_batch_option "@catppuccin_window_current_right_separator" "$window_right_separator")
fi
if [ "$fill" = "none" ]; then
local show_number="#[fg=$thm_fg,bg=$thm_gray]$number"
local show_middle_separator="#[fg=$thm_fg,bg=$thm_gray,nobold,nounderscore,noitalics]$window_middle_separator"