diff --git a/README.md b/README.md index b50433a..7754b46 100644 --- a/README.md +++ b/README.md @@ -67,55 +67,10 @@ set -g @catppuccin_flavour 'latte' # or frappe, macchiato, mocha 1. Copy your desired theme's configuration contents into your Tmux config (usually stored at `~/.tmux.conf`) 2. Reload Tmux by either restarting the session or reloading it with `tmux source-file ~/.tmux.conf` -## Status line themes +## Overview +![Default](./assets/overview.png) -### Default - -![Default](./assets/default-no-wt.webp) - -With window tabs option enabled - -![Default with wt enabled](./assets/default.webp) - -### Pill shape - -```sh -set -g @catppuccin_pill_theme_enabled on -``` - -![Pill shape](./assets/pill.webp) - -### Powerline - -```sh -set -g @catppuccin_powerline_theme_enabled on -set -g @catppuccin_l_left_separator "" -set -g @catppuccin_l_right_separator "" -set -g @catppuccin_r_left_separator "" -set -g @catppuccin_r_right_separator "" -``` - -![Powerline](./assets/powerline.webp) - -### Powerline with icons - -```sh -set -g @catppuccin_powerline_icons_theme_enabled on -set -g @catppuccin_l_left_separator "" -set -g @catppuccin_l_right_separator "" -set -g @catppuccin_r_left_separator "" -set -g @catppuccin_r_right_separator "" -``` - -![Powerline with icons](./assets/powerline-icons.webp) - -### No patched fonts - -```sh -set -g @catppuccin_no_patched_fonts_theme_enabled on -``` - -![No patched fonts](./assets/no-patched-fonts.webp) +This is a diagram on how the theme is split between it's components. ## Configuration options @@ -123,70 +78,236 @@ All flavours support certain levels of customization that match our [Catppuccin Style Guide][style-guide]. To add these customizations, add any of the following options to your Tmux configuration. -### Enable window tabs - -By default, the theme places the `window-status` in the `status-right`. With -`@catppuccin_window_tabs_enabled` set to `on`, the theme will place the -directory within the `status-right` and move the window names to the -`window-status` format variables. +### Window +#### Set the window left separator: ```sh -set -g @catppuccin_window_tabs_enabled on # or off to disable window_tabs +set -g @catppuccin_window_left_separator "█" ``` -### Configure separator - -By default, the theme will use a round separator. -To overwrite it use `@catppuccin_l_left_separator`, `@catppuccin_l_right_separator` for left status / window tabs and `@catppuccin_r_left_separator`, `@catppuccin_r_right_separator` for right status. - -With the default status line theme - +#### Set the window middle separator: ```sh -set -g @catppuccin_l_right_separator "█" -set -g @catppuccin_r_left_separator "█" +set -g @catppuccin_window_middle_separator "█" ``` -### Enable DateTime - -By default, the `date_time` component is set to off. -It can be enabled by specifying any tmux date and time format. - +#### Set the window right separator: ```sh -set -g @catppuccin_date_time "%Y-%m-%d %H:%M" +set -g @catppuccin_window_right_separator "█" ``` -### Enable User - -By default, the `user` component is set to off. -It can be enabled by toggling it on. - +#### Position the number: ```sh -set -g @catppuccin_user "on" +set -g @catppuccin_window_number_position "left" +``` +Values: +- left - the number will be on the left part of the window +- right - the number will be on the right part of the window + +#### Enable window status: +```sh +set -g @ccatppuccin_window_status_enable "yes" +``` +Values: +- yes - this will enable the window status part +- no - this will disable the window status part + +#### Enable window status icons instead of text: +```sh +set -g @catppuccin_window_status_icon_enable "yes" +``` +Values: +- yes - this will replace the windows status text with icons +- no - this will keep the windows status in text format + +### Override windows status icons +```sh +set -g @catppuccin_icon_window_last "󰖰" +set -g @catppuccin_icon_window_current "󰖯" +set -g @catppuccin_icon_window_zoom "󰁌" +set -g @catppuccin_icon_window_mark "󰃀" +set -g @catppuccin_icon_window_silent "󰂛" +set -g @catppuccin_icon_window_activity "󰖲" +set -g @catppuccin_icon_window_bell "󰂞" ``` -### Enable Host - -By default, the `host` component is set to off. -It can be enabled by toggling it on. +### Window default +#### Set the window default color fill: ```sh -set -g @catppuccin_host "on" +set -g @catppuccin_window_default_fill "number" +``` +Values: +- number - only the number of the window part will have color +- all - the entire window part will have the same color +- none - the entire window part will have no color + +#### Override the window default text: +```sh +set -g @catppuccin_window_default_text "#{b:pane_current_path}" # use "#W" for application instead of directory ``` -### Customize Icons +### Window current -Each of the components comes with their own default icon, which -can be changed to fit your preference or requirements of your font. - -*Note: NerdFont Icons do not render properly in the Github UI, so the below example -does not use them* +#### Set the window current color fill: ```sh -set -g @catppuccin_datetime_icon "A" -set -g @catppuccin_user_icon "B" -set -g @catppuccin_directory_icon "C" -set -g @catppuccin_window_icon "D" -set -g @catppuccin_session_icon "E" -set -g @catppuccin_host_icon "F" +set -g @catppuccin_window_current_fill "number" +``` +Values: +- number - only the number of the window part will have color +- all - the entire window part will have the same color +- none - the entire window part will have no color + +#### Override the window current text: +```sh +set -g @catppuccin_window_current_text "#{b:pane_current_path}" # use "#W" for application instead of directory +``` + +#### Set the current directory format +```sh +set -g @catppuccin_window_current_format_directory_text "#{b:pane_current_path}" +``` +Use this to overide the way the current directory is displayed. + +#### Set the directory format +```sh +set -g @catppuccin_window_format_directory_text "#{b:pane_current_path}" +``` +Use this to overide the way the directory is displayed. + +### Status + +#### Set the status module left separator: +```sh +set -g @catppuccin_status_left_separator "" +``` + +#### Set the status module right separator: +```sh +set -g @catppuccin_status_right_separator "█" +``` + +#### Set the status module right separator inverse: +```sh +set -g @catppuccin_status_right_separator_inverse "no" +``` +Values: +- yes - the colors will be inverted for the right separator +- no - the colors will not be inverted for the right separator + +#### Set the status connect separator: +```sh +set -g @catppuccin_status_connect_separator "yes" +``` +Values: +- yes - the background color of the separator will not blend in with the brackground color of tmux +- no - the background color of the separator will blend in with the brackground color of tmux + +#### Set the status module color fill: +```sh +set -g @catppuccin_status_color_fill "icon" +``` +Values: +- icon - only the icon of the module will have color +- all - the entire module will have the same color + +#### Set the module list +```sh +set -g @catppuccin_status_modules" "application session" +``` +Provide a list of modules and the order in which you want them to appear in the status. + +Available modules: +- application - display the current window running application +- directory - display the basename of the current window path +- session - display the number of tmux sessions running +- user - display the username +- host - display the hostname +- date_time - display the date and time + +### Customizing modules + +Every module (except the module "session") supports the following overrides: + +#### Override the specific module icon +```sh +set -g @catppuccin_[module_name]_icon" "icon" +``` + +#### Override the specific module color +```sh +set -g @catppuccin_[module_name]_color" "color" +``` + +#### Override the specific module text +```sh +set -g @catppuccin_[module_name]_text" "text" +``` + +## Configuration Examples + +### Config 1 +![Default](./assets/config1.png) + +```sh +set -g @catppuccin_window_right_separator "█ " +set -g @catppuccin_window_number_position "right" +set -g @catppuccin_window_middle_separator " | " + +set -g @catppuccin_window_default_fill "none" + +set -g @catppuccin_window_current_fill "all" + +set -g @catppuccin_status_modules "application session user host date_time" +set -g @catppuccin_status_left_separator "█" + +set -g @catppuccin_date_time_text "%Y-%m-%d %H:%M:%S" +``` + +### Config 2 +![Default](./assets/config2.png) + +```sh +set -g @catppuccin_window_left_separator "█" +set -g @catppuccin_window_right_separator "█ " +set -g @catppuccin_window_number_position "right" +set -g @catppuccin_window_middle_separator " █" + +set -g @catppuccin_window_default_fill "number" + +set -g @catppuccin_window_current_fill "number" +set -g @catppuccin_window_current_text "#{pane_current_path}" + +set -g @catppuccin_status_modules "application session date_time" +set -g @catppuccin_status_left_separator "" +set -g @catppuccin_status_right_separator " " +set -g @catppuccin_status_right_separator_inverse "yes" +set -g @catppuccin_status_color_fill "all" +set -g @catppuccin_status_connect_separator "no" +``` + +### Config 3 +![Default](./assets/config3.png) + +```sh +set -g @catppuccin_window_left_separator "" +set -g @catppuccin_window_right_separator " " +set -g @catppuccin_window_icon_position "right" +set -g @catppuccin_window_middle_separator " █" + +set -g @catppuccin_window_default_fill "number" +set -g @catppuccin_window_default_text "#W" + +set -g @catppuccin_window_current_fill "number" +set -g @catppuccin_window_current_text "#W" + +set -g @catppuccin_status_modules "directory user host session" +set -g @catppuccin_status_left_separator " " +set -g @catppuccin_status_right_separator "" +set -g @catppuccin_status_right_separator_inverse "no" +set -g @catppuccin_status_color_fill "icon" +set -g @catppuccin_status_connect_separator "no" + +set -g @catppuccin_directory_text "#{pane_current_path}" ``` [style-guide]: https://github.com/catppuccin/catppuccin/blob/main/docs/style-guide.md diff --git a/assets/config1.png b/assets/config1.png new file mode 100644 index 0000000..d75206b Binary files /dev/null and b/assets/config1.png differ diff --git a/assets/config2.png b/assets/config2.png new file mode 100644 index 0000000..eb5eb8c Binary files /dev/null and b/assets/config2.png differ diff --git a/assets/config3.png b/assets/config3.png new file mode 100644 index 0000000..91b8454 Binary files /dev/null and b/assets/config3.png differ diff --git a/assets/default-no-wt.webp b/assets/default-no-wt.webp deleted file mode 100644 index cbc1b92..0000000 Binary files a/assets/default-no-wt.webp and /dev/null differ diff --git a/assets/default.webp b/assets/default.webp deleted file mode 100644 index 9ed0f4b..0000000 Binary files a/assets/default.webp and /dev/null differ diff --git a/assets/no-patched-fonts.webp b/assets/no-patched-fonts.webp deleted file mode 100644 index 3387d6e..0000000 Binary files a/assets/no-patched-fonts.webp and /dev/null differ diff --git a/assets/overview.png b/assets/overview.png new file mode 100644 index 0000000..f26e899 Binary files /dev/null and b/assets/overview.png differ diff --git a/assets/pill.webp b/assets/pill.webp deleted file mode 100644 index e4ba925..0000000 Binary files a/assets/pill.webp and /dev/null differ diff --git a/assets/powerline-icons.webp b/assets/powerline-icons.webp deleted file mode 100644 index 2229086..0000000 Binary files a/assets/powerline-icons.webp and /dev/null differ diff --git a/assets/powerline.webp b/assets/powerline.webp deleted file mode 100644 index 2ee1889..0000000 Binary files a/assets/powerline.webp and /dev/null differ diff --git a/catppuccin.tmux b/catppuccin.tmux index df29d12..4384473 100755 --- a/catppuccin.tmux +++ b/catppuccin.tmux @@ -31,6 +31,160 @@ setw() { tmux_commands+=(set-window-option -gq "$option" "$value" ";") } +build_window_icon() { + local window_status_icon_enable="$(get_tmux_option "@catppuccin_window_status_icon_enable" "yes")" + + local custom_icon_window_last="$(get_tmux_option "@catppuccin_icon_window_last" "󰖰")" + local custom_icon_window_current="$(get_tmux_option "@catppuccin_icon_window_current" "󰖯")" + local custom_icon_window_zoom="$(get_tmux_option "@catppuccin_icon_window_zoom" "󰁌")" + local custom_icon_window_mark="$(get_tmux_option "@catppuccin_icon_window_mark" "󰃀")" + local custom_icon_window_silent="$(get_tmux_option "@catppuccin_icon_window_silent" "󰂛")" + local custom_icon_window_activity="$(get_tmux_option "@catppuccin_icon_window_activity" "󰖲")" + local custom_icon_window_bell="$(get_tmux_option "@catppuccin_icon_window_bell" "󰂞")" + + if [[ $window_status_icon_enable == "yes" ]] + then + local show_window_status="#(printf '%%s\n' '#F' | sed \"s/*/${custom_icon_window_current}/\" | sed \"s/-/${custom_icon_window_last}/\" | sed \"s/#/${custom_icon_window_activity}/\" | sed \"s/#//g\"| sed \"s/~/${custom_icon_window_silent}/\" | sed \"s/!/${custom_icon_window_bell}/\" | sed \"s/M/${custom_icon_window_mark}/\" | sed \"s/Z/${custom_icon_window_zoom}/\")" + fi + + if [[ $window_status_icon_enable == "no" ]] + then + local show_window_status="#F" + fi + + echo $show_window_status +} + +build_window_format() { + local number="$1" + local color="$2" + local background="$3" + local text="$4" + local fill="$5" + + if [[ $window_status_enable == "yes" ]] + then + local icon="$( build_window_icon )" + text="$text $icon" + fi + + if [[ $fill == "none" ]] + then + local show_left_separator="#[fg=$thm_gray,bg=$thm_bg,nobold,nounderscore,noitalics]$window_left_separator" + 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" + local show_text="#[fg=$thm_fg,bg=$thm_gray]$text" + local show_right_separator="#[fg=$thm_gray,bg=$thm_bg]$window_right_separator" + + fi + + if [[ $fill == "all" ]] + then + local show_left_separator="#[fg=$color,bg=$thm_bg,nobold,nounderscore,noitalics]$window_left_separator" + local show_number="#[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" + + fi + + if [[ $fill == "number" ]] + then + local show_number="#[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_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_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" + fi + + fi + + local window_format + + if [[ $window_number_position == "right" ]] + then + window_format="$show_left_separator$show_text$show_middle_separator$show_number$show_right_separator" + fi + + if [[ $window_number_position == "left" ]] + then + window_format="$show_left_separator$show_number$show_middle_separator$show_text$show_right_separator" + fi + + echo $window_format +} + +build_status_module() { + local index="$1" + local icon="$2" + local color="$3" + local text="$4" + + if [[ $index -eq 0 || $status_connect_separator == "no" ]] + then + local show_left_separator="#[fg=$color,bg=$thm_bg,nobold,nounderscore,noitalics]$status_left_separator" + else + local show_left_separator="#[fg=$color,bg=$thm_gray,nobold,nounderscore,noitalics]$status_left_separator" + fi + + 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_fill == "all" ]] + then + local show_icon="#[fg=$thm_bg,bg=$color,nobold,nounderscore,noitalics]$icon " + local show_text="#[fg=$thm_bg,bg=$color]$text" + local show_right_separator="#[fg=$color,bg=$thm_bg,nobold,nounderscore,noitalics]$status_right_separator" + fi + + if [[ $status_right_separator_inverse == "yes" ]] + then + local show_right_separator="#[fg=$thm_bg,bg=$color,nobold,nounderscore,noitalics]$status_right_separator" + fi + + echo "$show_left_separator$show_icon$show_text$show_right_separator" +} + +load_modules() { + local loaded_modules + + local modules_path=$1 + local modules_list=$2 + + local modules_array + read -a modules_array <<< "$modules_list" + + local module_index=0; + 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 $module_index )" + module_index=$module_index+1 + fi + + done + + echo $loaded_modules +} + main() { local theme theme="$(get_tmux_option "@catppuccin_flavour" "mocha")" @@ -65,141 +219,29 @@ 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_number_position="$(get_tmux_option "@catppuccin_window_number_position" "left")" # right, left + local window_status_enable="$(get_tmux_option "@catppuccin_window_status_enable" "no")" # right, left - 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_format=$( load_modules "$PLUGIN_DIR/window" "window_default_format") + local window_current_format=$( load_modules "$PLUGIN_DIR/window" "window_current_format") - 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 + setw window-status-format "${window_format}" + setw window-status-current-format "${window_current_format}" - local l_right_separator - l_right_separator="$(get_tmux_option "@catppuccin_l_right_separator" "")" - readonly l_right_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_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_fill="$(get_tmux_option "@catppuccin_status_fill" "icon")" - # Separators for the right status - local r_left_separator - r_left_separator="$(get_tmux_option "@catppuccin_r_left_separator" "")" - readonly r_left_separator - - 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 "" - set status-right "${right_column1}${right_column2}" - - 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/src/default.conf b/src/default.conf deleted file mode 100644 index 63eb008..0000000 --- a/src/default.conf +++ /dev/null @@ -1,29 +0,0 @@ -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} " - -local show_directory_in_window_status_current -readonly show_directory_in_window_status_current="#[fg=$thm_bg,bg=$thm_orange] #I #[fg=$thm_fg,bg=$thm_bg] #{b:pane_current_path} " - -local show_window_in_window_status -readonly show_window_in_window_status="#[fg=$thm_fg,bg=$thm_bg] #W #[fg=$thm_bg,bg=$thm_blue] #I#[fg=$thm_blue,bg=$thm_bg]$l_right_separator " - -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/src/no-patched-fonts-status-line.conf b/src/no-patched-fonts-status-line.conf deleted file mode 100644 index c3cfdd8..0000000 --- a/src/no-patched-fonts-status-line.conf +++ /dev/null @@ -1,29 +0,0 @@ -local show_directory -readonly show_directory="#[fg=$thm_bg,bg=$thm_pink,nobold,nounderscore,noitalics] #{b:pane_current_path} #[bg=$thm_bg] " - -local show_window -readonly show_window="#[fg=$thm_bg,bg=$thm_pink,nobold,nounderscore,noitalics] #W #[bg=$thm_bg] " - -local show_session -readonly show_session="#{?client_prefix,#[bg=$thm_red],#[bg=$thm_green]}#[fg=$thm_bg] #S #[bg=$thm_bg] " - -local show_directory_in_window_status -readonly show_directory_in_window_status="#[fg=$thm_bg,bg=$thm_blue,nobold,nounderscore,noitalics] #I #[fg=$thm_fg,bg=$thm_gray,nobold,nounderscore,noitalics] #{b:pane_current_path} " - -local show_directory_in_window_status_current -readonly show_directory_in_window_status_current="#[fg=$thm_bg,bg=$thm_orange,nobold,nounderscore,noitalics] #I #[fg=$thm_fg,bg=$thm_bg,nobold,nounderscore,noitalics] #{b:pane_current_path} " - -local show_window_in_window_status -readonly show_window_in_window_status="#[fg=$thm_fg,bg=$thm_bg,nobold,nounderscore,noitalics] #W #[fg=$thm_bg,bg=$thm_blue,nobold,nounderscore,noitalics] #I " - -local show_window_in_window_status_current -readonly show_window_in_window_status_current="#[fg=$thm_fg,bg=$thm_gray,nobold,nounderscore,noitalics] #W #[fg=$thm_bg,bg=$thm_orange,nobold,nounderscore,noitalics] #I " - -local show_user -readonly show_user="#[fg=$thm_bg,bg=$thm_cyan,nobold,nounderscore,noitalics] #(whoami) #[bg=$thm_bg] " - -local show_host -readonly show_host="#[fg=$thm_bg,bg=$thm_magenta,nobold,nounderscore,noitalics] #H #[bg=$thm_bg] " - -local show_date_time -readonly show_date_time="#[fg=$thm_bg,bg=$thm_blue,nobold,nounderscore,noitalics] $date_time #[bg=$thm_bg] " diff --git a/src/pill-status-line.conf b/src/pill-status-line.conf deleted file mode 100644 index d2b84a4..0000000 --- a/src/pill-status-line.conf +++ /dev/null @@ -1,29 +0,0 @@ -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} #[fg=$thm_gray,bg=$thm_bg,nobold,nounderscore,noitalics]$r_right_separator " - -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 #[fg=$thm_gray,bg=$thm_bg,nobold,nounderscore,noitalics]$r_right_separator " - -local show_session -readonly show_session="#[fg=$thm_green,bg=$thm_bg,nobold,nounderscore,noitalics]#{?client_prefix,#[fg=$thm_red],#[fg=$thm_green]}$r_left_separator#[fg=$thm_bg,bg=$thm_green]#{?client_prefix,#[bg=$thm_red],#[bg=$thm_green]}$session_icon #[fg=$thm_fg,bg=$thm_gray] #S #[fg=$thm_gray,bg=$thm_bg,nobold,nounderscore,noitalics]$r_right_separator " - -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} " - -local show_directory_in_window_status_current -readonly show_directory_in_window_status_current="#[fg=$thm_bg,bg=$thm_orange] #I #[fg=$thm_fg,bg=$thm_bg] #{b:pane_current_path} " - -local show_window_in_window_status -readonly show_window_in_window_status="#[fg=$thm_gray,bg=$thm_bg,nobold,nounderscore,noitalics]$l_left_separator#[fg=$thm_fg,bg=$thm_gray]#W #[fg=$thm_bg,bg=$thm_blue] #I#[fg=$thm_blue,bg=$thm_bg,nobold,nounderscore,noitalics]$l_right_separator " - -local show_window_in_window_status_current -readonly show_window_in_window_status_current="#[fg=$thm_gray,bg=$thm_bg,nobold,nounderscore,noitalics]$l_left_separator#[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_bg,nobold,nounderscore,noitalics]$r_left_separator#[fg=$thm_bg,bg=$thm_cyan,nobold,nounderscore,noitalics]$user_icon #[fg=$thm_fg,bg=$thm_gray] #(whoami) #[fg=$thm_gray,bg=$thm_bg,nobold,nounderscore,noitalics]$r_right_separator " - -local show_host -readonly show_host="#[fg=$thm_magenta,bg=$thm_bg,nobold,nounderscore,noitalics]$r_left_separator#[fg=$thm_bg,bg=$thm_magenta,nobold,nounderscore,noitalics]$host_icon #[fg=$thm_fg,bg=$thm_gray] #H #[fg=$thm_gray,bg=$thm_bg,nobold,nounderscore,noitalics]$r_right_separator " - -local show_date_time -readonly show_date_time="#[fg=$thm_blue,bg=$thm_bg,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 #[fg=$thm_gray,bg=$thm_bg,nobold,nounderscore,noitalics]$r_right_separator " diff --git a/src/powerline-icons-status-line.conf b/src/powerline-icons-status-line.conf deleted file mode 100644 index 479f6ce..0000000 --- a/src/powerline-icons-status-line.conf +++ /dev/null @@ -1,30 +0,0 @@ -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 #{b:pane_current_path} $r_right_separator" - -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 #W $r_right_separator" - -local show_session -readonly show_session="#[fg=$thm_green,bg=$thm_bg,nobold,nounderscore,noitalics]#{?client_prefix,#[fg=$thm_red],#[fg=$thm_green]}$r_left_separator#{?client_prefix,#[bg=$thm_red],#[bg=$thm_green]}#[fg=$thm_bg] $session_icon #S #{?client_prefix,#[bg=$thm_red],#[bg=$thm_green]}#[fg=$thm_bg]$r_right_separator" - -local show_directory_in_window_status -readonly show_directory_in_window_status="#[fg=$thm_bg,bg=$thm_gray,nobold,noitalics,nounderscore]$l_left_separator #[fg=$thm_fg,bg=$thm_gray,nobold,noitalics,nounderscore]#I  #{b:pane_current_path} #[fg=$thm_gray,bg=$thm_bg,nobold,noitalics,nounderscore]$l_right_separator" - -local show_directory_in_window_status_current -readonly show_directory_in_window_status_current="#[fg=$thm_bg,bg=$thm_blue,nobold,noitalics,nounderscore]$l_left_separator #[fg=$thm_bg,bg=$thm_blue,nobold,noitalics,nounderscore]#I  #{b:pane_current_path} #[fg=$thm_blue,bg=$thm_bg,nobold,noitalics,nounderscore]$l_right_separator" - -local show_window_in_window_status -readonly show_window_in_window_status="#[fg=$thm_bg,bg=$thm_gray,nobold,noitalics,nounderscore]$l_left_separator #[fg=$thm_fg,bg=$thm_gray,nobold,noitalics,nounderscore]#W  #I #[fg=$thm_gray,bg=$thm_bg,nobold,noitalics,nounderscore]$l_right_separator" - -local show_window_in_window_status_current -readonly show_window_in_window_status_current="#[fg=$thm_bg,bg=$thm_blue,nobold,noitalics,nounderscore]$l_left_separator #[fg=$thm_bg,bg=$thm_blue,nobold,noitalics,nounderscore]#W  #I #[fg=$thm_blue,bg=$thm_bg,nobold,noitalics,nounderscore]$l_right_separator" - -local show_user -readonly show_user="#[fg=$thm_cyan,bg=$thm_bg,nobold,nounderscore,noitalics]$r_left_separator#[fg=$thm_bg,bg=$thm_cyan,nobold,nounderscore,noitalics] $user_icon #(whoami) $r_right_separator" - -local show_host -readonly show_host="#[fg=$thm_magenta,bg=$thm_bg,nobold,nounderscore,noitalics]$r_left_separator#[fg=$thm_bg,bg=$thm_magenta,nobold,nounderscore,noitalics] $host_icon #H $r_right_separator" - -local show_date_time -readonly show_date_time="#[fg=$thm_blue,bg=$thm_bg,nobold,nounderscore,noitalics]$r_left_separator#[fg=$thm_bg,bg=$thm_blue,nobold,nounderscore,noitalics] $datetime_icon $date_time $r_right_separator" - diff --git a/src/powerline-status-line.conf b/src/powerline-status-line.conf deleted file mode 100644 index 217c1c6..0000000 --- a/src/powerline-status-line.conf +++ /dev/null @@ -1,29 +0,0 @@ -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] #{b:pane_current_path} $r_right_separator" - -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] #W $r_right_separator" - -local show_session -readonly show_session="#[fg=$thm_green,bg=$thm_bg,nobold,nounderscore,noitalics]#{?client_prefix,#[fg=$thm_red],#[fg=$thm_green]}$r_left_separator#{?client_prefix,#[bg=$thm_red],#[bg=$thm_green]}#[fg=$thm_bg] #S #{?client_prefix,#[bg=$thm_red],#[bg=$thm_green]}#[fg=$thm_bg]$r_right_separator" - -local show_directory_in_window_status -readonly show_directory_in_window_status="#[fg=$thm_bg,bg=$thm_gray,nobold,noitalics,nounderscore]$l_left_separator #[fg=$thm_fg,bg=$thm_gray,nobold,noitalics,nounderscore]#I  #{b:pane_current_path} #[fg=$thm_gray,bg=$thm_bg,nobold,noitalics,nounderscore]$l_right_separator" - -local show_directory_in_window_status_current -readonly show_directory_in_window_status_current="#[fg=$thm_bg,bg=$thm_blue,nobold,noitalics,nounderscore]$l_left_separator #[fg=$thm_bg,bg=$thm_blue,nobold,noitalics,nounderscore]#I  #{b:pane_current_path} #[fg=$thm_blue,bg=$thm_bg,nobold,noitalics,nounderscore]$l_right_separator" - -local show_window_in_window_status -readonly show_window_in_window_status="#[fg=$thm_bg,bg=$thm_gray,nobold,noitalics,nounderscore]$l_left_separator #[fg=$thm_fg,bg=$thm_gray,nobold,noitalics,nounderscore]#W  #I #[fg=$thm_gray,bg=$thm_bg,nobold,noitalics,nounderscore]$l_right_separator" - -local show_window_in_window_status_current -readonly show_window_in_window_status_current="#[fg=$thm_bg,bg=$thm_blue,nobold,noitalics,nounderscore]$l_left_separator #[fg=$thm_bg,bg=$thm_blue,nobold,noitalics,nounderscore]#W  #I #[fg=$thm_blue,bg=$thm_bg,nobold,noitalics,nounderscore]$l_right_separator" - -local show_user -readonly show_user="#[fg=$thm_cyan,bg=$thm_bg,nobold,nounderscore,noitalics]$r_left_separator#[fg=$thm_bg,bg=$thm_cyan,nobold,nounderscore,noitalics] #(whoami) $r_right_separator" - -local show_host -readonly show_host="#[fg=$thm_magenta,bg=$thm_bg,nobold,nounderscore,noitalics]$r_left_separator#[fg=$thm_bg,bg=$thm_magenta,nobold,nounderscore,noitalics] #H $r_right_separator" - -local show_date_time -readonly show_date_time="#[fg=$thm_blue,bg=$thm_bg,nobold,nounderscore,noitalics]$r_left_separator#[fg=$thm_bg,bg=$thm_blue,nobold,nounderscore,noitalics] $date_time $r_right_separator" diff --git a/status/application.sh b/status/application.sh new file mode 100644 index 0000000..5427479 --- /dev/null +++ b/status/application.sh @@ -0,0 +1,10 @@ +show_application() { + local index=$1 + local icon="$(get_tmux_option "@catppuccin_application_icon" "")" + local color="$(get_tmux_option "@catppuccin_application_color" "$thm_pink")" + local text="$(get_tmux_option "@catppuccin_application_text" "#W")" + + local module=$( build_status_module "$index" "$icon" "$color" "$text" ) + + echo $module +} diff --git a/status/date_time.sh b/status/date_time.sh new file mode 100644 index 0000000..858639a --- /dev/null +++ b/status/date_time.sh @@ -0,0 +1,11 @@ +show_date_time() { + local index=$1 + local icon="$(get_tmux_option "@catppuccin_date_time_icon" "󰃰")" + local color="$(get_tmux_option "@catppuccin_date_time_color" "$thm_blue")" + local text="$(get_tmux_option "@catppuccin_date_time_text" "%Y-%m-%d %H:%M")" + + local module=$( build_status_module "$index" "$icon" "$color" "$text" ) + + echo $module +} + diff --git a/status/directory.sh b/status/directory.sh new file mode 100644 index 0000000..5d382f8 --- /dev/null +++ b/status/directory.sh @@ -0,0 +1,10 @@ +show_directory() { + local index=$1 + local icon="$(get_tmux_option "@catppuccin_directory_icon" "")" + local color="$(get_tmux_option "@catppuccin_directory_color" "$thm_pink")" + local text="$(get_tmux_option "@catppuccin_directory_text" "#{b:pane_current_path}")" + + local module=$( build_status_module "$index" "$icon" "$color" "$text" ) + + echo $module +} diff --git a/status/host.sh b/status/host.sh new file mode 100644 index 0000000..73d8393 --- /dev/null +++ b/status/host.sh @@ -0,0 +1,10 @@ +show_host() { + local index=$1 + local icon="$(get_tmux_option "@catppuccin_host_icon" "󰒋")" + local color="$(get_tmux_option "@catppuccin_host_color" "$thm_magenta")" + local text="$(get_tmux_option "@catppuccin_host_text" "#H")" + + local module=$( build_status_module "$index" "$icon" "$color" "$text" ) + + echo $module +} diff --git a/status/session.sh b/status/session.sh new file mode 100644 index 0000000..039c779 --- /dev/null +++ b/status/session.sh @@ -0,0 +1,33 @@ +show_session() { + local index=$1 + local icon="$(get_tmux_option "@catppuccin_session_icon" "")" + local text="$(get_tmux_option "@catppuccin_session_text" "#S")" + + if [[ $index -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 " + + 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_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" + fi + + if [[ $status_right_separator_inverse == "yes" ]] + then + local show_right_separator="#[fg=$thm_bg]$status_right_separator" + fi + + 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..fc9b9ed --- /dev/null +++ b/status/user.sh @@ -0,0 +1,10 @@ +show_user() { + local index=$1 + local icon="$(get_tmux_option "@catppuccin_user_icon" "")" + local color="$(get_tmux_option "@catppuccin_user_color" "$thm_cyan")" + local text="$(get_tmux_option "@catppuccin_user_text" "#(whoami)")" + + local module=$( build_status_module "$index" "$icon" "$color" "$text" ) + + echo $module +} diff --git a/window/window_current_format.sh b/window/window_current_format.sh new file mode 100644 index 0000000..88e9053 --- /dev/null +++ b/window/window_current_format.sh @@ -0,0 +1,11 @@ +show_window_current_format() { + local number="#I" + local color="$thm_orange" + local background="$thm_bg" + 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 + + 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" +}