Adding in the functionality; 🎉

This patch adds the functionality necessary to setup
@catppuccin_window_tabs_enabled for folks who expect something
differently than the initial design.
This commit is contained in:
Roger Steve Ruiz 2022-11-23 20:40:45 -05:00
parent 0d82738708
commit 6e5343e097
No known key found for this signature in database
GPG key ID: 68061DBF1C4C0B44

View file

@ -28,9 +28,7 @@ main() {
}
local theme
local window_tabs_enabled
theme="$(get-tmux-option "@catppuccin_flavour" "mocha")"
window_tabs_enabled="$(get-tmux-option "@catppuccin_window_tabs_enabled" "off")"
# NOTE: Pulling in the selected theme by the theme that's being set as local
# variables.
@ -62,7 +60,12 @@ main() {
# --------=== Statusline
# NOTE: Checking for the value of @catppuccin_window_tabs_enabled
wt_enabled="$(get-tmux-option "@catppuccin_window_tabs_enabled" "off")"
readonly wt_enabled
# These variables are the defaults so that the setw and set calls are easier to parse.
readonly show_directory="#[fg=$thm_pink,bg=$thm_bg,nobold,nounderscore,noitalics]#[fg=$thm_bg,bg=$thm_pink,nobold,nounderscore,noitalics] #[fg=$thm_fg,bg=$thm_gray] #{b:pane_current_path} #{?client_prefix,#[fg=$thm_red]"
readonly show_window="#[fg=$thm_pink,bg=$thm_bg,nobold,nounderscore,noitalics]#[fg=$thm_bg,bg=$thm_pink,nobold,nounderscore,noitalics] #[fg=$thm_fg,bg=$thm_gray] #W #{?client_prefix,#[fg=$thm_red]"
readonly show_session="#[fg=$thm_green]}#[bg=$thm_gray]#{?client_prefix,#[bg=$thm_red],#[bg=$thm_green]}#[fg=$thm_bg] #[fg=$thm_fg,bg=$thm_gray] #S "
@ -76,6 +79,15 @@ main() {
local window_status_format="#[fg=$thm_bg,bg=$thm_blue] #I #[fg=$thm_fg,bg=$thm_gray] #{b:pane_current_path} "
local window_status_current_format="#[fg=$thm_bg,bg=$thm_orange] #I #[fg=$thm_fg,bg=$thm_bg] #{b:pane_current_path} "
# 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="#[fg=$thm_fg,bg=$thm_bg] #W #[fg=$thm_bg,bg=$thm_blue] #I#[fg=$thm_blue,bg=$thm_bg]#[fg=$thm_fg,bg=$thm_bg,nobold,nounderscore,noitalics] "
window_status_current_format="#[fg=$thm_fg,bg=$thm_gray] #W #[fg=$thm_bg,bg=$thm_orange] #I#[fg=$thm_orange,bg=$thm_bg]#[fg=$thm_fg,bg=$thm_bg,nobold,nounderscore,noitalics] "
fi
set status-left ""
set status-right "${right_column1},${right_column2}"