From 56a447094a5c3f0eff9fc7b20d40ad81e5660bfe Mon Sep 17 00:00:00 2001 From: Valentin Uveges Date: Sun, 6 Aug 2023 20:51:23 +0300 Subject: [PATCH] feat(modules): extract all ui components into independend modules --- catppuccin.tmux | 158 +++--------------------- modules/date_time.sh | 14 --- src/default.conf | 18 --- status/application.sh | 16 +++ status/date_time.sh | 18 +++ status/directory.sh | 16 +++ status/host.sh | 16 +++ status/session.sh | 16 +++ status/user.sh | 16 +++ test_cat.sh | 30 ----- window/application_in_window.sh | 37 ++++++ window/application_in_window_current.sh | 40 ++++++ window/directory_in_window.sh | 38 ++++++ window/directory_in_window_current.sh | 41 ++++++ 14 files changed, 274 insertions(+), 200 deletions(-) delete mode 100644 modules/date_time.sh create mode 100644 status/application.sh create mode 100644 status/date_time.sh create mode 100644 status/directory.sh create mode 100644 status/host.sh create mode 100644 status/session.sh create mode 100644 status/user.sh delete mode 100755 test_cat.sh create mode 100644 window/application_in_window.sh create mode 100644 window/application_in_window_current.sh create mode 100644 window/directory_in_window.sh create mode 100644 window/directory_in_window_current.sh diff --git a/catppuccin.tmux b/catppuccin.tmux index 207aab4..4d8b787 100755 --- a/catppuccin.tmux +++ b/catppuccin.tmux @@ -40,6 +40,7 @@ load_modules() { local modules_array read -a modules_array <<< "$modules_list" + local module_index=0; local module_name for module_name in ${modules_array[@]} do @@ -48,7 +49,8 @@ load_modules() { if [[ 0 -eq $? ]] then - loaded_modules=$loaded_modules$( show_$module_name ) + loaded_modules="$loaded_modules$( show_$module_name $module_index )" + module_index=$module_index+1 fi done @@ -90,150 +92,30 @@ main() { # --------=== Statusline - # NOTE: Checking for the value of @catppuccin_window_tabs_enabled - local wt_enabled - wt_enabled="$(get_tmux_option "@catppuccin_window_tabs_enabled" "off")" - readonly wt_enabled - - local pill_theme_enabled - pill_theme_enabled="$(get_tmux_option "@catppuccin_pill_theme_enabled" "off")" - readonly pill_theme_enabled - - local powerline_theme_enabled - powerline_theme_enabled="$(get_tmux_option "@catppuccin_powerline_theme_enabled" "off")" - readonly powerline_theme_enabled + 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_color_fill="$(get_tmux_option "@catppuccin_window_color_fill" "number")" + local window_icon_position="$(get_tmux_option "@catppuccin_window_icon_position" "right")" - local powerline_icons_theme_enabled - powerline_icons_theme_enabled="$(get_tmux_option "@catppuccin_powerline_icons_theme_enabled" "off")" - readonly powerline_icons_theme_enabled + local window_module="$(get_tmux_option "@catppuccin_window_module" "directory_in_window")" + local window_current_module="$(get_tmux_option "@catppuccin_window_current_module" "directory_in_window_current")" - local no_patched_fonts_theme_enabled - no_patched_fonts_theme_enabled="$(get_tmux_option "@catppuccin_no_patched_fonts_theme_enabled" "off")" - readonly no_patched_fonts_theme_enabled - - # Separators for the left status / window list - local l_left_separator - l_left_separator="$(get_tmux_option "@catppuccin_l_left_separator" "")" - readonly l_left_separator + local window_format=$( load_modules "$PLUGIN_DIR/window" "$window_module") + local window_current_format=$( load_modules "$PLUGIN_DIR/window" "$window_current_module") - local l_right_separator - l_right_separator="$(get_tmux_option "@catppuccin_l_right_separator" "")" - readonly l_right_separator + setw window-status-format "${window_format}" + setw window-status-current-format "${window_current_format}" - # Separators for the right status - local r_left_separator - r_left_separator="$(get_tmux_option "@catppuccin_r_left_separator" "")" - readonly r_left_separator + local status_left_separator="$(get_tmux_option "@catppuccin_status_left_separator" " ")" + local status_right_separator="$(get_tmux_option "@catppuccin_status_right_separator" "█")" + local status_connect_separator="$(get_tmux_option "@catppuccin_status_connect_separator" "yes")" - local r_right_separator - r_right_separator="$(get_tmux_option "@catppuccin_r_right_separator" "")" - readonly r_right_separator - - local user - user="$(get_tmux_option "@catppuccin_user" "off")" - readonly user - - local host - host="$(get_tmux_option "@catppuccin_host" "off")" - readonly host - - local date_time - date_time="$(get_tmux_option "@catppuccin_date_time" "off")" - readonly date_time - - # Icons - local directory_icon - directory_icon="$(get_tmux_option "@catppuccin_directory_icon" "")" - readonly directory_icon - - local window_icon - window_icon="$(get_tmux_option "@catppuccin_window_icon" "")" - readonly window_icon - - local session_icon - session_icon="$(get_tmux_option "@catppuccin_session_icon" "")" - readonly session_icon - - local user_icon - user_icon="$(get_tmux_option "@catppuccin_user_icon" "")" - readonly user_icon - - local host_icon - host_icon="$(get_tmux_option "@catppuccin_host_icon" "󰒋")" - readonly host_icon - - local datetime_icon - datetime_icon="$(get_tmux_option "@catppuccin_datetime_icon" "")" - readonly datetime_icon - - # Source status line themes - if [[ "${pill_theme_enabled}" == "off" ]] && - [[ "${powerline_theme_enabled}" == "off" ]] && - [[ "${powerline_icons_theme_enabled}" == "off" ]] && - [[ "${no_patched_fonts_theme_enabled}" == "off" ]]; then - source "$PLUGIN_DIR/$DEFAULT_STATUS_LINE_FILE" - fi - - if [[ "${pill_theme_enabled}" == "on" ]]; then - source "$PLUGIN_DIR/$PILL_STATUS_LINE_FILE" - fi - - if [[ "${powerline_theme_enabled}" == "on" ]]; then - source "$PLUGIN_DIR/$POWERLINE_STATUS_LINE_FILE" - fi - - if [[ "${powerline_icons_theme_enabled}" == "on" ]]; then - source "$PLUGIN_DIR/$POWERLINE_ICONS_STATUS_LINE_FILE" - fi - - if [[ "${no_patched_fonts_theme_enabled}" == "on" ]]; then - source "$PLUGIN_DIR/$NO_PATCHED_FONTS_STATUS_LINE_FILE" - fi - - # Right column 1 by default shows the Window name. - local right_column1=$show_window - - # Right column 2 by default shows the current Session name. - local right_column2=$show_session - - # Window status by default shows the current directory basename. - local window_status_format=$show_directory_in_window_status - local window_status_current_format=$show_directory_in_window_status_current - - # NOTE: With the @catppuccin_window_tabs_enabled set to on, we're going to - # update the right_column1 and the window_status_* variables. - if [[ "${wt_enabled}" == "on" ]]; then - right_column1=$show_directory - window_status_format=$show_window_in_window_status - window_status_current_format=$show_window_in_window_status_current - fi - - if [[ "${user}" == "on" ]]; then - right_column2="$right_column2$show_user" - fi - - if [[ "${host}" == "on" ]]; then - right_column2="$right_column2$show_host" - fi - - if [[ "${date_time}" != "off" ]]; then - right_column2="$right_column2$show_date_time" - fi + local status_modules="$(get_tmux_option "@catppuccin_status_modules" "application session")" + local loaded_modules=$( load_modules "$PLUGIN_DIR/status" "$status_modules") set status-left "" - - - local status_left_separator=$r_left_separator - local status_right_separator=$l_right_separator - - local status_modules="$(get_tmux_option "@catppuccin_status_modules" "")" - - local loaded_modules=$( load_modules "$PLUGIN_DIR/modules" "$status_modules") - set status-right "${right_column1}${right_column2}${loaded_modules}" - - - setw window-status-format "${window_status_format}" - setw window-status-current-format "${window_status_current_format}" + set status-right "${loaded_modules}" # --------=== Modes # diff --git a/modules/date_time.sh b/modules/date_time.sh deleted file mode 100644 index 04c737f..0000000 --- a/modules/date_time.sh +++ /dev/null @@ -1,14 +0,0 @@ -show_date_time() { - local date_time_icon="$(get_tmux_option "@catppuccin_datetime_icon" "󰃰")" - local date_time_format="$(get_tmux_option "@catppuccin_date_time_format" "%Y-%m-%d %H:%M")" - - local show_left_separator="#[fg=$thm_blue,bg=$thm_bg,nobold,nounderscore,noitalics]$status_left_separator" - local show_date_time_icon="#[fg=$thm_bg,bg=$thm_blue,nobold,nounderscore,noitalics]$datetime_icon" - local show_date_time_text="#[fg=$thm_fg,bg=$thm_gray]$date_time_format" - local show_right_separator="#[fg=$thm_gray,bg=$thm_bg,nobold,nounderscore,noitalics]$status_right_separator" - - local show_date_time=$show_left_separator$show_date_time_icon" "$show_date_time_text$show_right_separator - - echo $show_date_time -} - diff --git a/src/default.conf b/src/default.conf index 63eb008..caa46bd 100644 --- a/src/default.conf +++ b/src/default.conf @@ -1,12 +1,3 @@ -local show_directory -readonly show_directory="#[fg=$thm_pink,bg=$thm_bg,nobold,nounderscore,noitalics]$r_left_separator#[fg=$thm_bg,bg=$thm_pink,nobold,nounderscore,noitalics]$directory_icon #[fg=$thm_fg,bg=$thm_gray] #{b:pane_current_path} " - -local show_window -readonly show_window="#[fg=$thm_pink,bg=$thm_bg,nobold,nounderscore,noitalics]$r_left_separator#[fg=$thm_bg,bg=$thm_pink,nobold,nounderscore,noitalics]$window_icon #[fg=$thm_fg,bg=$thm_gray] #W " - -local show_session -readonly show_session="#[fg=$thm_green]#[bg=$thm_gray]#{?client_prefix,#[fg=$thm_red],#[fg=$thm_green]}$r_left_separator#{?client_prefix,#[bg=$thm_red],#[bg=$thm_green]}#[fg=$thm_bg]$session_icon #[fg=$thm_fg,bg=$thm_gray] #S " - local show_directory_in_window_status readonly show_directory_in_window_status="#[fg=$thm_bg,bg=$thm_blue] #I #[fg=$thm_fg,bg=$thm_gray] #{b:pane_current_path} " @@ -18,12 +9,3 @@ readonly show_window_in_window_status="#[fg=$thm_fg,bg=$thm_bg] #W #[fg=$thm_bg, local show_window_in_window_status_current readonly show_window_in_window_status_current="#[fg=$thm_fg,bg=$thm_gray] #W #[fg=$thm_bg,bg=$thm_orange] #I#[fg=$thm_orange,bg=$thm_bg,nobold,nounderscore,noitalics]$l_right_separator " - -local show_user -readonly show_user="#[fg=$thm_cyan,bg=$thm_gray,nobold,nounderscore,noitalics]$r_left_separator#[fg=$thm_bg,bg=$thm_cyan,nobold,nounderscore,noitalics]$user_icon #[fg=$thm_fg,bg=$thm_gray] #(whoami) " - -local show_host -readonly show_host="#[fg=$thm_magenta,bg=$thm_gray,nobold,nounderscore,noitalics]$r_left_separator#[fg=$thm_bg,bg=$thm_magenta,nobold,nounderscore,noitalics]$host_icon #[fg=$thm_fg,bg=$thm_gray] #H " - -local show_date_time -readonly show_date_time="#[fg=$thm_blue,bg=$thm_gray,nobold,nounderscore,noitalics]$r_left_separator#[fg=$thm_bg,bg=$thm_blue,nobold,nounderscore,noitalics]$datetime_icon #[fg=$thm_fg,bg=$thm_gray] $date_time " diff --git a/status/application.sh b/status/application.sh new file mode 100644 index 0000000..6ccf44a --- /dev/null +++ b/status/application.sh @@ -0,0 +1,16 @@ +show_application() { + local icon="$(get_tmux_option "@catppuccin_application_icon" "")" + + if [[ $1 -eq 0 || $status_connect_separator == "no" ]] + then + local show_left_separator="#[fg=$thm_pink,bg=$thm_bg,nobold,nounderscore,noitalics]$status_left_separator" + else + local show_left_separator="#[fg=$thm_pink,bg=$thm_gray,nobold,nounderscore,noitalics]$status_left_separator" + fi + + local show_icon="#[fg=$thm_bg,bg=$thm_pink,nobold,nounderscore,noitalics]$icon " + local show_text="#[fg=$thm_fg,bg=$thm_gray] #W" + local show_right_separator="#[fg=$thm_gray,bg=$thm_bg,nobold,nounderscore,noitalics]$status_right_separator" + + echo "$show_left_separator$show_icon$show_text$show_right_separator" +} diff --git a/status/date_time.sh b/status/date_time.sh new file mode 100644 index 0000000..76000a4 --- /dev/null +++ b/status/date_time.sh @@ -0,0 +1,18 @@ +show_date_time() { + local icon="$(get_tmux_option "@catppuccin_datetime_icon" "󰃰")" + local format="$(get_tmux_option "@catppuccin_date_time_format" "%Y-%m-%d %H:%M")" + + if [[ $1 -eq 0 || $status_connect_separator == "no" ]] + then + local show_left_separator="#[fg=$thm_blue,bg=$thm_bg,nobold,nounderscore,noitalics]$status_left_separator" + else + local show_left_separator="#[fg=$thm_blue,bg=$thm_gray,nobold,nounderscore,noitalics]$status_left_separator" + fi + + local show_icon="#[fg=$thm_bg,bg=$thm_blue,nobold,nounderscore,noitalics]$icon " + local show_text="#[fg=$thm_fg,bg=$thm_gray] $format" + local show_right_separator="#[fg=$thm_gray,bg=$thm_bg,nobold,nounderscore,noitalics]$status_right_separator" + + echo "$show_left_separator$show_icon$show_text$show_right_separator" +} + diff --git a/status/directory.sh b/status/directory.sh new file mode 100644 index 0000000..16c2f5c --- /dev/null +++ b/status/directory.sh @@ -0,0 +1,16 @@ +show_directory() { + local icon="$(get_tmux_option "@catppuccin_directory_icon" "")" + + if [[ $1 -eq 0 || $status_connect_separator == "no" ]] + then + local show_left_separator="#[fg=$thm_pink,bg=$thm_bg,nobold,nounderscore,noitalics]$status_left_separator" + else + local show_left_separator="#[fg=$thm_pink,bg=$thm_gray,nobold,nounderscore,noitalics]$status_left_separator" + fi + + local show_icon="#[fg=$thm_bg,bg=$thm_pink,nobold,nounderscore,noitalics]$icon " + local show_text="#[fg=$thm_fg,bg=$thm_gray] #{b:pane_current_path}" + local show_right_separator="#[fg=$thm_gray,bg=$thm_bg,nobold,nounderscore,noitalics]$status_right_separator" + + echo "$show_left_separator$show_icon$show_text$show_right_separator" +} diff --git a/status/host.sh b/status/host.sh new file mode 100644 index 0000000..970d369 --- /dev/null +++ b/status/host.sh @@ -0,0 +1,16 @@ +show_host() { + local icon="$(get_tmux_option "@catppuccin_host_icon" "󰒋")" + + if [[ $1 -eq 0 || $status_connect_separator == "no" ]] + then + local show_left_separator="#[fg=$thm_blue,bg=$thm_bg,nobold,nounderscore,noitalics]$status_left_separator" + else + local show_left_separator="#[fg=$thm_blue,bg=$thm_gray,nobold,nounderscore,noitalics]$status_left_separator" + fi + + local show_icon="#[fg=$thm_bg,bg=$thm_blue,nobold,nounderscore,noitalics]$icon " + local show_text="#[fg=$thm_fg,bg=$thm_gray] #H" + local show_right_separator="#[fg=$thm_gray,bg=$thm_bg,nobold,nounderscore,noitalics]$status_right_separator" + + echo "$show_left_separator$show_icon$show_text$show_right_separator" +} diff --git a/status/session.sh b/status/session.sh new file mode 100644 index 0000000..cea9d12 --- /dev/null +++ b/status/session.sh @@ -0,0 +1,16 @@ +show_session() { + local icon="$(get_tmux_option "@catppuccin_session_icon" "")" + + if [[ $1 -eq 0 || $status_connect_separator == "no" ]] + then + local show_left_separator="#[fg=$thm_green]#[bg=$thm_bg]#{?client_prefix,#[fg=$thm_red],#[fg=$thm_green]}$status_left_separator" + else + local show_left_separator="#[fg=$thm_green]#[bg=$thm_gray]#{?client_prefix,#[fg=$thm_red],#[fg=$thm_green]}$status_left_separator" + fi + + local show_icon="#{?client_prefix,#[bg=$thm_red],#[bg=$thm_green]}#[fg=$thm_bg]$icon " + local show_text="#[fg=$thm_fg,bg=$thm_gray] #S" + local show_right_separator="#[fg=$thm_gray,bg=$thm_bg,nobold,nounderscore,noitalics]$status_right_separator" + + echo "$show_left_separator$show_icon$show_text$show_right_separator" +} diff --git a/status/user.sh b/status/user.sh new file mode 100644 index 0000000..da494eb --- /dev/null +++ b/status/user.sh @@ -0,0 +1,16 @@ +show_user() { + local icon="$(get_tmux_option "@catppuccin_user_icon" "")" + + if [[ $1 -eq 0 || $status_connect_separator == "no" ]] + then + local show_left_separator="#[fg=$thm_blue,bg=$thm_bg,nobold,nounderscore,noitalics]$status_left_separator" + else + local show_left_separator="#[fg=$thm_blue,bg=$thm_gray,nobold,nounderscore,noitalics]$status_left_separator" + fi + + local show_icon="#[fg=$thm_bg,bg=$thm_blue,nobold,nounderscore,noitalics]$icon " + local show_text="#[fg=$thm_fg,bg=$thm_gray] #(whoami)" + local show_right_separator="#[fg=$thm_gray,bg=$thm_bg,nobold,nounderscore,noitalics]$status_right_separator" + + echo "$show_left_separator$show_icon$show_text$show_right_separator" +} diff --git a/test_cat.sh b/test_cat.sh deleted file mode 100755 index ff16ce2..0000000 --- a/test_cat.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash - -load_modules() { - local loaded_modules - - local modules_path=$1 - local modules_list=$2 - - local modules_array - read -a modules_array <<< "$modules_list" - - local module_name - for module_name in ${modules_array[@]} - do - local module_path=$modules_path/$module_name.sh - source $module_path - - if [[ 0 -eq $? ]] - then - loaded_modules=$loaded_modules$( show_$module_name ) - fi - - done - - echo $loaded_modules -} - -module_path="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"/modules -module_list="user host date_time" -echo $( load_modules "$module_path" "$module_list" ) diff --git a/window/application_in_window.sh b/window/application_in_window.sh new file mode 100644 index 0000000..0de86e7 --- /dev/null +++ b/window/application_in_window.sh @@ -0,0 +1,37 @@ +show_application_in_window() { + if [[ $window_color_fill == "number" ]] + then + local show_icon="#[fg=$thm_bg,bg=$thm_blue]#I" + local show_middle_separator="#[fg=$thm_blue,bg=$thm_gray,nobold,nounderscore,noitalics]$window_middle_separator" + local show_text="#[fg=$thm_fg,bg=$thm_gray]#W" + + if [[ $window_icon_position == "right" ]] + then + local show_left_separator="#[fg=$thm_gray,bg=$thm_bg,nobold,nounderscore,noitalics]$window_left_separator" + local show_right_separator="#[fg=$thm_blue,bg=$thm_bg]$window_right_separator" + + echo "$show_left_separator$show_text$show_middle_separator$show_icon$show_right_separator" + else + local show_left_separator="#[fg=$thm_blue,bg=$thm_bg,nobold,nounderscore,noitalics]$window_left_separator" + local show_right_separator="#[fg=$thm_gray,bg=$thm_bg]$window_right_separator" + + echo "$show_left_separator$show_icon$show_middle_separator$show_text$show_right_separator" + fi + + else + local show_left_separator="#[fg=$thm_blue,bg=$thm_bg,nobold,nounderscore,noitalics]$window_left_separator" + local show_icon="#[fg=$thm_bg,bg=$thm_blue]#I" + local show_middle_separator="#[fg=$thm_gray,bg=$thm_blue,nobold,nounderscore,noitalics]$window_middle_separator" + local show_text="#[fg=$thm_bg,bg=$thm_blue]#{b:pane_current_path}" + local show_right_separator="#[fg=$thm_blue,bg=$thm_bg]$window_right_separator" + + if [[ $window_icon_position == "right" ]] + then + echo "$show_left_separator$show_text$show_middle_separator$show_icon$show_right_separator" + + else + echo "$show_left_separator$show_icon$show_middle_separator$show_text$show_right_separator" + fi + + fi +} diff --git a/window/application_in_window_current.sh b/window/application_in_window_current.sh new file mode 100644 index 0000000..51f8d3e --- /dev/null +++ b/window/application_in_window_current.sh @@ -0,0 +1,40 @@ +show_application_in_window_current() { + if [[ $window_color_fill == "number" ]] + then + local show_icon="#[fg=$thm_bg,bg=$thm_orange]#I" + local show_middle_separator="#[fg=$thm_orange,bg=$thm_bg,nobold,nounderscore,noitalics]$window_middle_separator" + local show_text="#[fg=$thm_fg,bg=$thm_bg]#W" + + if [[ $window_icon_position == "right" ]] + then + local show_left_separator="#[fg=$thm_bg,bg=$thm_bg,nobold,nounderscore,noitalics]$window_left_separator" + local show_right_separator="#[fg=$thm_orange,bg=$thm_bg]$window_right_separator" + + echo "$show_left_separator$show_text$show_middle_separator$show_icon$show_right_separator" + + else + local show_left_separator="#[fg=$thm_orange,bg=$thm_bg,nobold,nounderscore,noitalics]$window_left_separator" + local show_right_separator="#[fg=$thm_bg,bg=$thm_bg]$window_right_separator" + + echo "$show_left_separator$show_icon$show_middle_separator$show_text$show_right_separator" + + fi + + else + local show_left_separator="#[fg=$thm_orange,bg=$thm_bg,nobold,nounderscore,noitalics]$window_left_separator" + local show_icon="#[fg=$thm_bg,bg=$thm_orange]#I" + local show_middle_separator="#[fg=$thm_bg,bg=$thm_orange,nobold,nounderscore,noitalics]$window_middle_separator" + local show_text="#[fg=$thm_bg,bg=$thm_orange]#{b:pane_current_path}" + local show_right_separator="#[fg=$thm_orange,bg=$thm_bg]$window_right_separator" + + if [[ $window_icon_position == "right" ]] + then + echo "$show_left_separator$show_text$show_middle_separator$show_icon$show_right_separator" + + else + echo "$show_left_separator$show_icon$show_middle_separator$show_text$show_right_separator" + + fi + + fi +} diff --git a/window/directory_in_window.sh b/window/directory_in_window.sh new file mode 100644 index 0000000..457b340 --- /dev/null +++ b/window/directory_in_window.sh @@ -0,0 +1,38 @@ +show_directory_in_window() { + if [[ $window_color_fill == "number" ]] + then + local show_icon="#[fg=$thm_bg,bg=$thm_blue]#I" + local show_middle_separator="#[fg=$thm_blue,bg=$thm_gray,nobold,nounderscore,noitalics]$window_middle_separator" + local show_text="#[fg=$thm_fg,bg=$thm_gray]#{b:pane_current_path}" + + if [[ $window_icon_position == "right" ]] + then + local show_left_separator="#[fg=$thm_gray,bg=$thm_bg,nobold,nounderscore,noitalics]$window_left_separator" + local show_right_separator="#[fg=$thm_blue,bg=$thm_bg]$window_right_separator" + + echo "$show_left_separator$show_text$show_middle_separator$show_icon$show_right_separator" + else + local show_left_separator="#[fg=$thm_blue,bg=$thm_bg,nobold,nounderscore,noitalics]$window_left_separator" + local show_right_separator="#[fg=$thm_gray,bg=$thm_bg]$window_right_separator" + + echo "$show_left_separator$show_icon$show_middle_separator$show_text$show_right_separator" + fi + + else + local show_left_separator="#[fg=$thm_blue,bg=$thm_bg,nobold,nounderscore,noitalics]$window_left_separator" + local show_icon="#[fg=$thm_bg,bg=$thm_blue]#I" + local show_middle_separator="#[fg=$thm_gray,bg=$thm_blue,nobold,nounderscore,noitalics]$window_middle_separator" + local show_text="#[fg=$thm_bg,bg=$thm_blue]#{b:pane_current_path}" + local show_right_separator="#[fg=$thm_blue,bg=$thm_bg]$window_right_separator" + + if [[ $window_icon_position == "right" ]] + then + echo "$show_left_separator$show_text$show_middle_separator$show_icon$show_right_separator" + + else + echo "$show_left_separator$show_icon$show_middle_separator$show_text$show_right_separator" + fi + + fi + +} diff --git a/window/directory_in_window_current.sh b/window/directory_in_window_current.sh new file mode 100644 index 0000000..e4c12d5 --- /dev/null +++ b/window/directory_in_window_current.sh @@ -0,0 +1,41 @@ +show_directory_in_window_current() { + if [[ $window_color_fill == "number" ]] + then + local show_icon="#[fg=$thm_bg,bg=$thm_orange]#I" + local show_middle_separator="#[fg=$thm_orange,bg=$thm_bg,nobold,nounderscore,noitalics]$window_middle_separator" + local show_text="#[fg=$thm_fg,bg=$thm_bg]#{b:pane_current_path}" + + if [[ $window_icon_position == "right" ]] + then + local show_left_separator="#[fg=$thm_bg,bg=$thm_bg,nobold,nounderscore,noitalics]$window_left_separator" + local show_right_separator="#[fg=$thm_orange,bg=$thm_bg]$window_right_separator" + + echo "$show_left_separator$show_text$show_middle_separator$show_icon$show_right_separator" + + else + local show_left_separator="#[fg=$thm_orange,bg=$thm_bg,nobold,nounderscore,noitalics]$window_left_separator" + local show_right_separator="#[fg=$thm_bg,bg=$thm_bg]$window_right_separator" + + echo "$show_left_separator$show_icon$show_middle_separator$show_text$show_right_separator" + + fi + + else + local show_left_separator="#[fg=$thm_orange,bg=$thm_bg,nobold,nounderscore,noitalics]$window_left_separator" + local show_icon="#[fg=$thm_bg,bg=$thm_orange]#I" + local show_middle_separator="#[fg=$thm_bg,bg=$thm_orange,nobold,nounderscore,noitalics]$window_middle_separator" + local show_text="#[fg=$thm_bg,bg=$thm_orange]#{b:pane_current_path}" + local show_right_separator="#[fg=$thm_orange,bg=$thm_bg]$window_right_separator" + + if [[ $window_icon_position == "right" ]] + then + echo "$show_left_separator$show_text$show_middle_separator$show_icon$show_right_separator" + + else + echo "$show_left_separator$show_icon$show_middle_separator$show_text$show_right_separator" + + fi + + fi + +}