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): window specific separator config #198

Merged
Merged
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
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,12 @@ Values:
set -g @catppuccin_window_current_text "#{b:pane_current_path}" # use "#W" for application instead of directory
```

#### Override the window current separators
```sh
set -g @catppuccin_window_current_left_separator ""
set -g @catppuccin_window_current_middle_separator "█"
set -g @catppuccin_window_current_right_separator ""
```
### Pane

#### Set the pane border style:
Expand Down
13 changes: 13 additions & 0 deletions builder/window_builder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion window/window_current_format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ show_window_current_format() {
text="$(get_tmux_batch_option "@catppuccin_window_current_text" "#{b:pane_current_path}")" # use #W for application instead of directory
fill="$(get_tmux_batch_option "@catppuccin_window_current_fill" "number")" # number, all, none

current_window_format=$(build_window_format "$number" "$color" "$background" "$text" "$fill")
current_window_format=$(build_window_format "$number" "$color" "$background" "$text" "$fill" "current")

echo "$current_window_format"
}
2 changes: 1 addition & 1 deletion window/window_default_format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ show_window_default_format() {
text="$(get_tmux_batch_option "@catppuccin_window_default_text" "#{b:pane_current_path}")" # use #W for application instead of directory
fill="$(get_tmux_batch_option "@catppuccin_window_default_fill" "number")" # number, all, none

default_window_format=$(build_window_format "$number" "$color" "$background" "$text" "$fill")
default_window_format=$(build_window_format "$number" "$color" "$background" "$text" "$fill" "default")

echo "$default_window_format"
}