diff --git a/catppuccin.tmux b/catppuccin.tmux index 369032c..fcae848 100755 --- a/catppuccin.tmux +++ b/catppuccin.tmux @@ -32,7 +32,7 @@ setw() { } build_window_format() { - local icon="$1" + local number="$1" local color="$2" local background="$3" local text="$4" @@ -45,7 +45,7 @@ build_window_format() { if [[ $fill == "none" ]] then local show_left_separator="#[fg=$thm_gray,bg=$thm_bg,nobold,nounderscore,noitalics]$window_left_separator" - local show_icon="#[fg=$thm_fg,bg=$thm_gray]$icon" + local show_icon="#[fg=$thm_fg,bg=$thm_gray]$number" local show_middle_separator="#[fg=$thm_fg,bg=$thm_gray,nobold,nounderscore,noitalics]$window_middle_separator" local show_text="#[fg=$thm_fg,bg=$thm_gray]$text" local show_right_separator="#[fg=$thm_gray,bg=$thm_bg]$window_right_separator" @@ -55,7 +55,7 @@ build_window_format() { if [[ $fill == "all" ]] then local show_left_separator="#[fg=$color,bg=$thm_bg,nobold,nounderscore,noitalics]$window_left_separator" - local show_icon="#[fg=$background,bg=$color]$icon" + local show_icon="#[fg=$background,bg=$color]$number" local show_middle_separator="#[fg=$background,bg=$color,nobold,nounderscore,noitalics]$window_middle_separator" local show_text="#[fg=$background,bg=$color]$text" local show_right_separator="#[fg=$color,bg=$thm_bg]$window_right_separator" @@ -64,17 +64,17 @@ build_window_format() { if [[ $fill == "number" ]] then - local show_icon="#[fg=$background,bg=$color]$icon" + local show_icon="#[fg=$background,bg=$color]$number" local show_middle_separator="#[fg=$color,bg=$background,nobold,nounderscore,noitalics]$window_middle_separator" local show_text="#[fg=$thm_fg,bg=$background]$text" - if [[ $window_icon_position == "right" ]] + if [[ $window_number_position == "right" ]] then local show_left_separator="#[fg=$background,bg=$thm_bg,nobold,nounderscore,noitalics]$window_left_separator" local show_right_separator="#[fg=$color,bg=$thm_bg]$window_right_separator" fi - if [[ $window_icon_position == "left" ]] + if [[ $window_number_position == "left" ]] then local show_right_separator="#[fg=$background,bg=$thm_bg,nobold,nounderscore,noitalics]$window_right_separator" local show_left_separator="#[fg=$color,bg=$thm_bg]$window_left_separator" @@ -82,12 +82,12 @@ build_window_format() { fi - if [[ $window_icon_position == "right" ]] + if [[ $window_number_position == "right" ]] then window_format="$show_left_separator$show_text$show_middle_separator$show_icon$show_right_separator" fi - if [[ $window_icon_position == "left" ]] + if [[ $window_number_position == "left" ]] then window_format="$show_left_separator$show_icon$show_middle_separator$show_text$show_right_separator" fi @@ -108,14 +108,14 @@ build_status_module() { local show_left_separator="#[fg=$color,bg=$thm_gray,nobold,nounderscore,noitalics]$status_left_separator" fi - if [[ $status_color_fill == "icon" ]] + if [[ $status_fill == "icon" ]] then local show_icon="#[fg=$thm_bg,bg=$color,nobold,nounderscore,noitalics]$icon " local show_text="#[fg=$thm_fg,bg=$thm_gray] $text" local show_right_separator="#[fg=$thm_gray,bg=$thm_bg,nobold,nounderscore,noitalics]$status_right_separator" fi - if [[ $status_color_fill == "all" ]] + if [[ $status_fill == "all" ]] then local show_icon="#[fg=$thm_bg,bg=$color,nobold,nounderscore,noitalics]$icon " local show_text="#[fg=$thm_bg,bg=$color]$text" @@ -194,10 +194,9 @@ main() { local window_left_separator="$(get_tmux_option "@catppuccin_window_left_separator" "█")" local window_right_separator="$(get_tmux_option "@catppuccin_window_right_separator" "█")" local window_middle_separator="$(get_tmux_option "@catppuccin_window_middle_separator" "█ ")" - local window_icon_position="$(get_tmux_option "@catppuccin_window_icon_position" "left")" # right, left - local window_format_style="$(get_tmux_option "@catppuccin_window_format_style" "directory")" # directory, application + local window_number_position="$(get_tmux_option "@catppuccin_window_number_position" "left")" # right, left - local window_format=$( load_modules "$PLUGIN_DIR/window" "window_format") + local window_format=$( load_modules "$PLUGIN_DIR/window" "window_default_format") local window_current_format=$( load_modules "$PLUGIN_DIR/window" "window_current_format") setw window-status-format "${window_format}" @@ -207,7 +206,7 @@ main() { local status_right_separator="$(get_tmux_option "@catppuccin_status_right_separator" "█")" local status_right_separator_inverse="$(get_tmux_option "@catppuccin_status_right_separator_inverse" "no")" local status_connect_separator="$(get_tmux_option "@catppuccin_status_connect_separator" "yes")" - local status_color_fill="$(get_tmux_option "@catppuccin_status_color_fill" "icon")" + local status_fill="$(get_tmux_option "@catppuccin_status_fill" "icon")" local status_modules="$(get_tmux_option "@catppuccin_status_modules" "application session")" local loaded_modules=$( load_modules "$PLUGIN_DIR/status" "$status_modules") diff --git a/status/session.sh b/status/session.sh index d471bc7..039c779 100644 --- a/status/session.sh +++ b/status/session.sh @@ -12,13 +12,13 @@ show_session() { local show_icon="#{?client_prefix,#[bg=$thm_red],#[bg=$thm_green]}#[fg=$thm_bg]$icon " - if [[ $status_color_fill == "icon" ]] + if [[ $status_fill == "icon" ]] then local show_text="#[fg=$thm_fg,bg=$thm_gray] $text" local show_right_separator="#[fg=$thm_gray,bg=$thm_bg,nobold,nounderscore,noitalics]$status_right_separator" fi - if [[ $status_color_fill == "all" ]] + if [[ $status_fill == "all" ]] then local show_text="#[fg=$thm_bg]$text" local show_right_separator="#[fg=$thm_green]#[bg=$thm_bg]#{?client_prefix,#[fg=$thm_red],#[fg=$thm_green]}$status_right_separator" diff --git a/window/window_current_format.sh b/window/window_current_format.sh index b2bf199..88e9053 100644 --- a/window/window_current_format.sh +++ b/window/window_current_format.sh @@ -1,21 +1,11 @@ show_window_current_format() { - local icon="#I" + local number="#I" local color="$thm_orange" local background="$thm_bg" - local text - local fill="$(get_tmux_option "@catppuccin_window_current_color_fill" "number")" # number, all, none + local text="$(get_tmux_option "@catppuccin_window_current_text" "#{b:pane_current_path}")" # use #W for application instead of directory + local fill="$(get_tmux_option "@catppuccin_window_current_fill" "number")" # number, all, none - if [[ $window_format_style == "directory" ]] - then - text="$(get_tmux_option "@catppuccin_window_current_format_directory_text" "#{b:pane_current_path}")" - fi - - if [[ $window_format_style == "application" ]] - then - text="#W" - fi - - local current_window_format=$( build_window_format "$icon" "$color" "$background" "$text" "$fill" ) + local current_window_format=$( build_window_format "$number" "$color" "$background" "$text" "$fill" ) echo "$current_window_format" } diff --git a/window/window_default_format.sh b/window/window_default_format.sh new file mode 100644 index 0000000..1f5f016 --- /dev/null +++ b/window/window_default_format.sh @@ -0,0 +1,11 @@ +show_window_default_format() { + local number="#I" + local color="$thm_blue" + local background="$thm_gray" + local text="$(get_tmux_option "@catppuccin_window_default_text" "#{b:pane_current_path}")" # use #W for application instead of directory + local fill="$(get_tmux_option "@catppuccin_window_default_fill" "number")" # number, all, none + + local default_window_format=$( build_window_format "$number" "$color" "$background" "$text" "$fill" ) + + echo "$default_window_format" +} diff --git a/window/window_format.sh b/window/window_format.sh deleted file mode 100644 index ad505e6..0000000 --- a/window/window_format.sh +++ /dev/null @@ -1,21 +0,0 @@ -show_window_format() { - local icon="#I" - local color="$thm_blue" - local background="$thm_gray" - local text - local fill="$(get_tmux_option "@catppuccin_window_color_fill" "number")" # number, all, none - - if [[ $window_format_style == "directory" ]] - then - text="$(get_tmux_option "@catppuccin_window_format_directory_text" "#{b:pane_current_path}")" - fi - - if [[ $window_format_style == "application" ]] - then - text="#W" - fi - - local current_window_format=$( build_window_format "$icon" "$color" "$background" "$text" "$fill") - - echo "$current_window_format" -}