From 7208fc8363a95d4af5560d434a6a6f9a1d667727 Mon Sep 17 00:00:00 2001 From: Roger Steve Ruiz Date: Wed, 23 Nov 2022 14:10:27 -0500 Subject: [PATCH 01/11] Adding option to enable window_tabs; This option, for now, defaults to false. This is just so it keeps the initial design intention for the original design of the plugin. I may flip it or change the name of the variable in future commits. This patch is addressing catppuccin/tmux#16. Co-Authored-By: Robert Menke --- catppuccin.tmux | 2 ++ 1 file changed, 2 insertions(+) diff --git a/catppuccin.tmux b/catppuccin.tmux index 928321f..ee2342c 100755 --- a/catppuccin.tmux +++ b/catppuccin.tmux @@ -16,7 +16,9 @@ get-tmux-option() { main() { local theme + local window_tabs_enabled theme="$(get-tmux-option "@catppuccin_flavour" "mocha")" + window_tabs_enabled="$(get-tmux-option "@catppuccin_window_tabs_enabled" "false")" tmux run -b "$CURRENT_DIR/catppuccin-${theme}.tmuxtheme" } From fb4e08d66ce21f82c230d88af168f1d71d334c67 Mon Sep 17 00:00:00 2001 From: Roger Steve Ruiz Date: Wed, 23 Nov 2022 14:50:03 -0500 Subject: [PATCH 02/11] Plumbing through the new variable to theme files; This is the start of plumbing things through into the theme files, but I do think that there is a better way here. I'm open to suggestions and will probably ask for some help in the Discord for Catppuccin. --- catppuccin-mocha.tmuxtheme | 11 ++++++++++- catppuccin.tmux | 2 ++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/catppuccin-mocha.tmuxtheme b/catppuccin-mocha.tmuxtheme index d0b64fa..85a95db 100755 --- a/catppuccin-mocha.tmuxtheme +++ b/catppuccin-mocha.tmuxtheme @@ -53,9 +53,18 @@ setw window-status-activity-style "fg=${thm_fg},bg=${thm_bg},none" setw window-status-separator "" setw window-status-style "fg=${thm_fg},bg=${thm_bg},none" +# TODO: continue implementing this later today... +wt_enabled=$(tmux show -gqv @catppuccin_window_tabs_enabled) + +status_left="" +if [[ "${wt_enabled}" == "on" ]] +then + status_left="window_tabs_enabled" +fi + # --------=== Statusline -set status-left "" +set status-left "#[fg=$thm_red,bg=$thm_bg,nobold,nounderscore,noitalics]$status_left#[fg=$thm_fg,bg=$thm_bg,nobold,nounderscore,noitalics]" set status-right "#[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],#[fg=$thm_green]}#[bg=$thm_gray]#{?client_prefix,#[bg=$thm_red],#[bg=$thm_green]}#[fg=$thm_bg] #[fg=$thm_fg,bg=$thm_gray] #S " # current_dir diff --git a/catppuccin.tmux b/catppuccin.tmux index ee2342c..75fe64c 100755 --- a/catppuccin.tmux +++ b/catppuccin.tmux @@ -10,6 +10,8 @@ get-tmux-option() { if [ -n "$value" ]; then echo "$value" else + # README: Set the default option if it's not set originally. + tmux set-option -gq "${option}" "${default}" echo "$default" fi } From 4b9a95361adb1b38acc2c7112a923f5d1513d64d Mon Sep 17 00:00:00 2001 From: Roger Steve Ruiz Date: Wed, 23 Nov 2022 18:18:05 -0500 Subject: [PATCH 03/11] Adding myself to contributors --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 6bf042c..4c764d3 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,7 @@ set -g @catppuccin_flavour 'latte' # or frappe, macchiato, mocha - [Pocco81](https://github.com/catppuccin) - [vinnyA3](https://github.com/vinnyA3) +- [rogeruiz](https://github.com/rogeruiz)   From d1bdc84ab211639a8ba20ad863066107ebb70eb4 Mon Sep 17 00:00:00 2001 From: Roger Steve Ruiz Date: Wed, 23 Nov 2022 18:21:15 -0500 Subject: [PATCH 04/11] Adding the initial pass at documentation; I'm aiming for having the Style Guide more exposed in the documentation. I'm expecting to be able to reference it if people start asking for things that would go against the guide. Also if anything I write that follows the guide but isn't accessible then maybe I can contribute back to the guide. --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index 4c764d3..48e776d 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,25 @@ 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` +#### Configuration options + +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. + +```sh +set -g @catppuccin_window_tabs_enabled on # or off to disable window_tabs +``` + +[style-guide]: https://github.com/catppuccin/catppuccin/blob/main/docs/style-guide.md + ## 💝 Thanks to - [Pocco81](https://github.com/catppuccin) From 1a8e901ec63c31d24e5387ea9427d06b211a897a Mon Sep 17 00:00:00 2001 From: Roger Steve Ruiz Date: Wed, 23 Nov 2022 19:06:47 -0500 Subject: [PATCH 05/11] Updating ignorance; This file should be ignored as it's getting modified by the main script to pull in the themes for each flavor of Catppuccin in a safe way for users running this script. --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5dedc76 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +# Let's not store the selected theme in version control. This file is used to +# source theme variables locally in the main function rather than polluting the +# global variable namespace. +catppuccin-selected-theme.tmuxtheme From e2b380a768a87378c623746890a9edbd1d80376a Mon Sep 17 00:00:00 2001 From: Roger Steve Ruiz Date: Wed, 23 Nov 2022 19:32:19 -0500 Subject: [PATCH 06/11] Refactor the theme selection; So the idea here is that the themes are only different based on the variables for the theme files. So this will change the theme variables to have `local` prefixes to keep the namespace regular. I decided to keep this like this until I get more feedback, because I think I could also just manually add the local to everything in the old `tmuxtheme` files. I chose this though because I really like how the `catppuccin-selected-theme` can be used for local debugging or testing out new colors if things were ever to need to be changed. If what that `sed` and `source` command is doing is unclear, I can do better about commenting around it. --- catppuccin-frappe.tmuxtheme | 54 ------------- catppuccin-latte.tmuxtheme | 54 ------------- catppuccin-macchiato.tmuxtheme | 54 ------------- catppuccin-mocha.tmuxtheme | 63 --------------- catppuccin.tmux | 137 +++++++++++++++++++++++++++++---- 5 files changed, 120 insertions(+), 242 deletions(-) mode change 100755 => 100644 catppuccin-frappe.tmuxtheme mode change 100755 => 100644 catppuccin-latte.tmuxtheme mode change 100755 => 100644 catppuccin-macchiato.tmuxtheme mode change 100755 => 100644 catppuccin-mocha.tmuxtheme diff --git a/catppuccin-frappe.tmuxtheme b/catppuccin-frappe.tmuxtheme old mode 100755 new mode 100644 index 8ed37a8..a38a73f --- a/catppuccin-frappe.tmuxtheme +++ b/catppuccin-frappe.tmuxtheme @@ -1,5 +1,3 @@ -#!/usr/bin/env bash - # NOTE: you can use vars with $ and ${} as long as the str is double quoted: "" # WARNING: hex colors can't contain capital letters @@ -17,55 +15,3 @@ thm_yellow="#e5c890" thm_blue="#8caaee" thm_orange="#ef9f76" thm_black4="#626880" - -# ----------------------------=== Theme ===-------------------------- - -# utils -set() { - local option=$1 - local value=$2 - tmux set-option -gq "$option" "$value" -} - -setw() { - local option=$1 - local value=$2 - tmux set-window-option -gq "$option" "$value" -} - -# status -set status "on" -set status-bg "${thm_bg}" -set status-justify "left" -set status-left-length "100" -set status-right-length "100" - -# messages -set message-style "fg=${thm_cyan},bg=${thm_gray},align=centre" -set message-command-style "fg=${thm_cyan},bg=${thm_gray},align=centre" - -# panes -set pane-border-style "fg=${thm_gray}" -set pane-active-border-style "fg=${thm_blue}" - -# windows -setw window-status-activity-style "fg=${thm_fg},bg=${thm_bg},none" -setw window-status-separator "" -setw window-status-style "fg=${thm_fg},bg=${thm_bg},none" - -# --------=== Statusline - -set status-left "" -set status-right "#[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],#[fg=$thm_green]}#[bg=$thm_gray]#{?client_prefix,#[bg=$thm_red],#[bg=$thm_green]}#[fg=$thm_bg] #[fg=$thm_fg,bg=$thm_gray] #S " - -# current_dir -setw window-status-format "#[fg=$thm_bg,bg=$thm_blue] #I #[fg=$thm_fg,bg=$thm_gray] #{b:pane_current_path} " -setw window-status-current-format "#[fg=$thm_bg,bg=$thm_orange] #I #[fg=$thm_fg,bg=$thm_bg] #{b:pane_current_path} " - -# parent_dir/current_dir -# setw window-status-format "#[fg=colour232,bg=colour111] #I #[fg=colour222,bg=colour235] #(echo '#{pane_current_path}' | rev | cut -d'/' -f-2 | rev) " -# setw window-status-current-format "#[fg=colour232,bg=colour208] #I #[fg=colour255,bg=colour237] #(echo '#{pane_current_path}' | rev | cut -d'/' -f-2 | rev) " - -# --------=== Modes -setw clock-mode-colour "${thm_blue}" -setw mode-style "fg=${thm_pink} bg=${thm_black4} bold" diff --git a/catppuccin-latte.tmuxtheme b/catppuccin-latte.tmuxtheme old mode 100755 new mode 100644 index 1ddb188..16f078f --- a/catppuccin-latte.tmuxtheme +++ b/catppuccin-latte.tmuxtheme @@ -1,5 +1,3 @@ -#!/usr/bin/env bash - # NOTE: you can use vars with $ and ${} as long as the str is double quoted: "" # WARNING: hex colors can't contain capital letters @@ -17,55 +15,3 @@ thm_yellow="#df8e1d" thm_blue="#1e66f5" thm_orange="#fe640b" thm_black4="#acb0be" - -# ----------------------------=== Theme ===-------------------------- - -# utils -set() { - local option=$1 - local value=$2 - tmux set-option -gq "$option" "$value" -} - -setw() { - local option=$1 - local value=$2 - tmux set-window-option -gq "$option" "$value" -} - -# status -set status "on" -set status-bg "${thm_bg}" -set status-justify "left" -set status-left-length "100" -set status-right-length "100" - -# messages -set message-style "fg=${thm_cyan},bg=${thm_gray},align=centre" -set message-command-style "fg=${thm_cyan},bg=${thm_gray},align=centre" - -# panes -set pane-border-style "fg=${thm_gray}" -set pane-active-border-style "fg=${thm_blue}" - -# windows -setw window-status-activity-style "fg=${thm_fg},bg=${thm_bg},none" -setw window-status-separator "" -setw window-status-style "fg=${thm_fg},bg=${thm_bg},none" - -# --------=== Statusline - -set status-left "" -set status-right "#[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],#[fg=$thm_green]}#[bg=$thm_gray]#{?client_prefix,#[bg=$thm_red],#[bg=$thm_green]}#[fg=$thm_bg] #[fg=$thm_fg,bg=$thm_gray] #S " - -# current_dir -setw window-status-format "#[fg=$thm_bg,bg=$thm_blue] #I #[fg=$thm_fg,bg=$thm_gray] #{b:pane_current_path} " -setw window-status-current-format "#[fg=$thm_bg,bg=$thm_orange] #I #[fg=$thm_fg,bg=$thm_bg] #{b:pane_current_path} " - -# parent_dir/current_dir -# setw window-status-format "#[fg=colour232,bg=colour111] #I #[fg=colour222,bg=colour235] #(echo '#{pane_current_path}' | rev | cut -d'/' -f-2 | rev) " -# setw window-status-current-format "#[fg=colour232,bg=colour208] #I #[fg=colour255,bg=colour237] #(echo '#{pane_current_path}' | rev | cut -d'/' -f-2 | rev) " - -# --------=== Modes -setw clock-mode-colour "${thm_blue}" -setw mode-style "fg=${thm_pink} bg=${thm_black4} bold" diff --git a/catppuccin-macchiato.tmuxtheme b/catppuccin-macchiato.tmuxtheme old mode 100755 new mode 100644 index 3b76e74..c90bf76 --- a/catppuccin-macchiato.tmuxtheme +++ b/catppuccin-macchiato.tmuxtheme @@ -1,5 +1,3 @@ -#!/usr/bin/env bash - # NOTE: you can use vars with $ and ${} as long as the str is double quoted: "" # WARNING: hex colors can't contain capital letters @@ -17,55 +15,3 @@ thm_yellow="#eed49f" thm_blue="#8aadf4" thm_orange="#f5a97f" thm_black4="#5b6078" - -# ----------------------------=== Theme ===-------------------------- - -# utils -set() { - local option=$1 - local value=$2 - tmux set-option -gq "$option" "$value" -} - -setw() { - local option=$1 - local value=$2 - tmux set-window-option -gq "$option" "$value" -} - -# status -set status "on" -set status-bg "${thm_bg}" -set status-justify "left" -set status-left-length "100" -set status-right-length "100" - -# messages -set message-style "fg=${thm_cyan},bg=${thm_gray},align=centre" -set message-command-style "fg=${thm_cyan},bg=${thm_gray},align=centre" - -# panes -set pane-border-style "fg=${thm_gray}" -set pane-active-border-style "fg=${thm_blue}" - -# windows -setw window-status-activity-style "fg=${thm_fg},bg=${thm_bg},none" -setw window-status-separator "" -setw window-status-style "fg=${thm_fg},bg=${thm_bg},none" - -# --------=== Statusline - -set status-left "" -set status-right "#[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],#[fg=$thm_green]}#[bg=$thm_gray]#{?client_prefix,#[bg=$thm_red],#[bg=$thm_green]}#[fg=$thm_bg] #[fg=$thm_fg,bg=$thm_gray] #S " - -# current_dir -setw window-status-format "#[fg=$thm_bg,bg=$thm_blue] #I #[fg=$thm_fg,bg=$thm_gray] #{b:pane_current_path} " -setw window-status-current-format "#[fg=$thm_bg,bg=$thm_orange] #I #[fg=$thm_fg,bg=$thm_bg] #{b:pane_current_path} " - -# parent_dir/current_dir -# setw window-status-format "#[fg=colour232,bg=colour111] #I #[fg=colour222,bg=colour235] #(echo '#{pane_current_path}' | rev | cut -d'/' -f-2 | rev) " -# setw window-status-current-format "#[fg=colour232,bg=colour208] #I #[fg=colour255,bg=colour237] #(echo '#{pane_current_path}' | rev | cut -d'/' -f-2 | rev) " - -# --------=== Modes -setw clock-mode-colour "${thm_blue}" -setw mode-style "fg=${thm_pink} bg=${thm_black4} bold" diff --git a/catppuccin-mocha.tmuxtheme b/catppuccin-mocha.tmuxtheme old mode 100755 new mode 100644 index 85a95db..41e6369 --- a/catppuccin-mocha.tmuxtheme +++ b/catppuccin-mocha.tmuxtheme @@ -1,5 +1,3 @@ -#!/usr/bin/env bash - # NOTE: you can use vars with $ and ${} as long as the str is double quoted: "" # WARNING: hex colors can't contain capital letters @@ -17,64 +15,3 @@ thm_yellow="#f9e2af" thm_blue="#89b4fa" thm_orange="#fab387" thm_black4="#585b70" - -# ----------------------------=== Theme ===-------------------------- - -# utils -set() { - local option=$1 - local value=$2 - tmux set-option -gq "$option" "$value" -} - -setw() { - local option=$1 - local value=$2 - tmux set-window-option -gq "$option" "$value" -} - -# status -set status "on" -set status-bg "${thm_bg}" -set status-justify "left" -set status-left-length "100" -set status-right-length "100" - -# messages -set message-style "fg=${thm_cyan},bg=${thm_gray},align=centre" -set message-command-style "fg=${thm_cyan},bg=${thm_gray},align=centre" - -# panes -set pane-border-style "fg=${thm_gray}" -set pane-active-border-style "fg=${thm_blue}" - -# windows -setw window-status-activity-style "fg=${thm_fg},bg=${thm_bg},none" -setw window-status-separator "" -setw window-status-style "fg=${thm_fg},bg=${thm_bg},none" - -# TODO: continue implementing this later today... -wt_enabled=$(tmux show -gqv @catppuccin_window_tabs_enabled) - -status_left="" -if [[ "${wt_enabled}" == "on" ]] -then - status_left="window_tabs_enabled" -fi - -# --------=== Statusline - -set status-left "#[fg=$thm_red,bg=$thm_bg,nobold,nounderscore,noitalics]$status_left#[fg=$thm_fg,bg=$thm_bg,nobold,nounderscore,noitalics]" -set status-right "#[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],#[fg=$thm_green]}#[bg=$thm_gray]#{?client_prefix,#[bg=$thm_red],#[bg=$thm_green]}#[fg=$thm_bg] #[fg=$thm_fg,bg=$thm_gray] #S " - -# current_dir -setw window-status-format "#[fg=$thm_bg,bg=$thm_blue] #I #[fg=$thm_fg,bg=$thm_gray] #{b:pane_current_path} " -setw window-status-current-format "#[fg=$thm_bg,bg=$thm_orange] #I #[fg=$thm_fg,bg=$thm_bg] #{b:pane_current_path} " - -# parent_dir/current_dir -# setw window-status-format "#[fg=colour232,bg=colour111] #I #[fg=colour222,bg=colour235] #(echo '#{pane_current_path}' | rev | cut -d'/' -f-2 | rev) " -# setw window-status-current-format "#[fg=colour232,bg=colour208] #I #[fg=colour255,bg=colour237] #(echo '#{pane_current_path}' | rev | cut -d'/' -f-2 | rev) " - -# --------=== Modes -setw clock-mode-colour "${thm_blue}" -setw mode-style "fg=${thm_pink} bg=${thm_black4} bold" diff --git a/catppuccin.tmux b/catppuccin.tmux index 75fe64c..6b4dda0 100755 --- a/catppuccin.tmux +++ b/catppuccin.tmux @@ -1,27 +1,130 @@ #!/usr/bin/env bash CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -get-tmux-option() { - local option value default - option="$1" - default="$2" - value="$(tmux show-option -gqv "$option")" - - if [ -n "$value" ]; then - echo "$value" - else - # README: Set the default option if it's not set originally. - tmux set-option -gq "${option}" "${default}" - echo "$default" - fi -} - main() { + # TODO: This function works great in here, but I'd like also like for it to set + # the option to the default if it's not set too. I'll get to it soon. + get-tmux-option() { + local option value default + option="$1" + default="$2" + value="$(tmux show-option -gqv "$option")" + + if [ -n "$value" ]; then + echo "$value" + else + # README: Set the default option if it's not set originally. + tmux set-option -gq "${option}" "${default}" + echo "$default" + fi + } + + set() { + local option=$1 + local value=$2 + tmux set-option -gq "$option" "$value" + } + + setw() { + local option=$1 + local value=$2 + tmux set-window-option -gq "$option" "$value" + } + local theme local window_tabs_enabled theme="$(get-tmux-option "@catppuccin_flavour" "mocha")" - window_tabs_enabled="$(get-tmux-option "@catppuccin_window_tabs_enabled" "false")" - tmux run -b "$CURRENT_DIR/catppuccin-${theme}.tmuxtheme" + 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. + sed -E 's/^(.+=)/local \1/' \ + > catppuccin-selected-theme.tmuxtheme \ + < "${CURRENT_DIR}/catppuccin-${theme}.tmuxtheme" + + source catppuccin-selected-theme.tmuxtheme + + # status + set status "on" + set status-bg "${thm_bg}" + set status-justify "left" + set status-left-length "100" + set status-right-length "100" + + # messages + set message-style "fg=${thm_cyan},bg=${thm_gray},align=centre" + set message-command-style "fg=${thm_cyan},bg=${thm_gray},align=centre" + + # panes + set pane-border-style "fg=${thm_gray}" + set pane-active-border-style "fg=${thm_blue}" + + # windows + setw window-status-activity-style "fg=${thm_fg},bg=${thm_bg},none" + setw window-status-separator "" + setw window-status-style "fg=${thm_fg},bg=${thm_bg},none" + + # --------=== Statusline + + set status-left "" + set status-right "#[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],#[fg=$thm_green]}#[bg=$thm_gray]#{?client_prefix,#[bg=$thm_red],#[bg=$thm_green]}#[fg=$thm_bg] #[fg=$thm_fg,bg=$thm_gray] #S " + + # current_dir + setw window-status-format "#[fg=$thm_bg,bg=$thm_blue] #I #[fg=$thm_fg,bg=$thm_gray] #{b:pane_current_path} " + setw window-status-current-format "#[fg=$thm_bg,bg=$thm_orange] #I #[fg=$thm_fg,bg=$thm_bg] #{b:pane_current_path} " + + # parent_dir/current_dir + # setw window-status-format "#[fg=colour232,bg=colour111] #I #[fg=colour222,bg=colour235] #(echo '#{pane_current_path}' | rev | cut -d'/' -f-2 | rev) " + # setw window-status-current-format "#[fg=colour232,bg=colour208] #I #[fg=colour255,bg=colour237] #(echo '#{pane_current_path}' | rev | cut -d'/' -f-2 | rev) " + + # --------=== Modes + setw clock-mode-colour "${thm_blue}" + setw mode-style "fg=${thm_pink} bg=${thm_black4} bold" + + # set status "on" + # set status-bg "${thm_bg}" + # set status-justify "left" + # set status-left-length "100" + # set status-right-length "100" + # + # # messages + # set message-style "fg=${thm_cyan},bg=${thm_gray},align=centre" + # set message-command-style "fg=${thm_cyan},bg=${thm_gray},align=centre" + # + # # panes + # set pane-border-style "fg=${thm_gray}" + # set pane-active-border-style "fg=${thm_blue}" + # + # # windows + # setw window-status-activity-style "fg=${thm_fg},bg=${thm_bg},none" + # setw window-status-separator "" + # setw window-status-style "fg=${thm_fg},bg=${thm_bg},none" + # + # # --------=== Statusline + # + # # TODO: continue implementing this later today... + # wt_enabled=$(tmux show -gqv @catppuccin_window_tabs_enabled) + # + # status_left="" + # if [[ "${wt_enabled}" == "on" ]] + # then + # status_left="window_tabs_enabled" + # fi + # + # set status-left "#[fg=$thm_red,bg=$thm_bg,nobold,nounderscore,noitalics]$status_left#[fg=$thm_fg,bg=$thm_bg,nobold,nounderscore,noitalics]" + # set status-right "#[fg=$thm_pink,bg=$thm_bg,nobold,nounderscore,noitalics]#[fg=$thm_bg,bg=$thm_pink,nobold,nounderscore,noitalics] #[fg=$thm_fg,bg=$thm_gray] #(echo '#{pane_current_path}' | rev | cut -d'/' -f-2 | rev) #{?client_prefix,#[fg=$thm_red],#[fg=$thm_green]}#[bg=$thm_gray]#{?client_prefix,#[bg=$thm_red],#[bg=$thm_green]}#[fg=$thm_bg] #[fg=$thm_fg,bg=$thm_gray] #S " + # + # # current_dir + # setw 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] " + # setw 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] " + # + # # parent_dir/current_dir + # # setw window-status-format "#[fg=colour232,bg=colour111] #I #[fg=colour222,bg=colour235] #(echo '#{pane_current_path}' | rev | cut -d'/' -f-2 | rev) " + # # setw window-status-current-format "#[fg=colour232,bg=colour208] #I #[fg=colour255,bg=colour237] #(echo '#{pane_current_path}' | rev | cut -d'/' -f-2 | rev) " + # + # # --------=== Modes + # setw clock-mode-colour "${thm_blue}" + # setw mode-style "fg=${thm_pink} bg=${thm_black4} bold" } main "$@" From 795a26c27832e24e112876f8067b3bfe9f8b25e1 Mon Sep 17 00:00:00 2001 From: Roger Steve Ruiz Date: Wed, 23 Nov 2022 20:20:55 -0500 Subject: [PATCH 07/11] Removing unnecessary comments --- catppuccin.tmux | 4 ---- 1 file changed, 4 deletions(-) diff --git a/catppuccin.tmux b/catppuccin.tmux index 6b4dda0..f1560ab 100755 --- a/catppuccin.tmux +++ b/catppuccin.tmux @@ -2,8 +2,6 @@ CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" main() { - # TODO: This function works great in here, but I'd like also like for it to set - # the option to the default if it's not set too. I'll get to it soon. get-tmux-option() { local option value default option="$1" @@ -13,8 +11,6 @@ main() { if [ -n "$value" ]; then echo "$value" else - # README: Set the default option if it's not set originally. - tmux set-option -gq "${option}" "${default}" echo "$default" fi } From 0d82738708b647a24d1096a381a242d9ce2fa1d8 Mon Sep 17 00:00:00 2001 From: Roger Steve Ruiz Date: Wed, 23 Nov 2022 20:26:48 -0500 Subject: [PATCH 08/11] Setting up the architecture a bit better; This architecture is now more extensible since all the display variables are decoupled from where the options get set. This will make customizing the theme with custom scripts more practical. --- catppuccin.tmux | 70 +++++++++++++------------------------------------ 1 file changed, 18 insertions(+), 52 deletions(-) diff --git a/catppuccin.tmux b/catppuccin.tmux index f1560ab..e13aef6 100755 --- a/catppuccin.tmux +++ b/catppuccin.tmux @@ -62,65 +62,31 @@ main() { # --------=== Statusline + # These variables are the defaults so that the setw and set calls are easier to parse. + 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 " + + # 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="#[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} " + set status-left "" - set status-right "#[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],#[fg=$thm_green]}#[bg=$thm_gray]#{?client_prefix,#[bg=$thm_red],#[bg=$thm_green]}#[fg=$thm_bg] #[fg=$thm_fg,bg=$thm_gray] #S " - # current_dir - setw window-status-format "#[fg=$thm_bg,bg=$thm_blue] #I #[fg=$thm_fg,bg=$thm_gray] #{b:pane_current_path} " - setw window-status-current-format "#[fg=$thm_bg,bg=$thm_orange] #I #[fg=$thm_fg,bg=$thm_bg] #{b:pane_current_path} " + set status-right "${right_column1},${right_column2}" - # parent_dir/current_dir - # setw window-status-format "#[fg=colour232,bg=colour111] #I #[fg=colour222,bg=colour235] #(echo '#{pane_current_path}' | rev | cut -d'/' -f-2 | rev) " - # setw window-status-current-format "#[fg=colour232,bg=colour208] #I #[fg=colour255,bg=colour237] #(echo '#{pane_current_path}' | rev | cut -d'/' -f-2 | rev) " + setw window-status-format "${window_status_format}" + setw window-status-current-format "${window_status_current_format}" # --------=== Modes + # setw clock-mode-colour "${thm_blue}" setw mode-style "fg=${thm_pink} bg=${thm_black4} bold" - - # set status "on" - # set status-bg "${thm_bg}" - # set status-justify "left" - # set status-left-length "100" - # set status-right-length "100" - # - # # messages - # set message-style "fg=${thm_cyan},bg=${thm_gray},align=centre" - # set message-command-style "fg=${thm_cyan},bg=${thm_gray},align=centre" - # - # # panes - # set pane-border-style "fg=${thm_gray}" - # set pane-active-border-style "fg=${thm_blue}" - # - # # windows - # setw window-status-activity-style "fg=${thm_fg},bg=${thm_bg},none" - # setw window-status-separator "" - # setw window-status-style "fg=${thm_fg},bg=${thm_bg},none" - # - # # --------=== Statusline - # - # # TODO: continue implementing this later today... - # wt_enabled=$(tmux show -gqv @catppuccin_window_tabs_enabled) - # - # status_left="" - # if [[ "${wt_enabled}" == "on" ]] - # then - # status_left="window_tabs_enabled" - # fi - # - # set status-left "#[fg=$thm_red,bg=$thm_bg,nobold,nounderscore,noitalics]$status_left#[fg=$thm_fg,bg=$thm_bg,nobold,nounderscore,noitalics]" - # set status-right "#[fg=$thm_pink,bg=$thm_bg,nobold,nounderscore,noitalics]#[fg=$thm_bg,bg=$thm_pink,nobold,nounderscore,noitalics] #[fg=$thm_fg,bg=$thm_gray] #(echo '#{pane_current_path}' | rev | cut -d'/' -f-2 | rev) #{?client_prefix,#[fg=$thm_red],#[fg=$thm_green]}#[bg=$thm_gray]#{?client_prefix,#[bg=$thm_red],#[bg=$thm_green]}#[fg=$thm_bg] #[fg=$thm_fg,bg=$thm_gray] #S " - # - # # current_dir - # setw 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] " - # setw 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] " - # - # # parent_dir/current_dir - # # setw window-status-format "#[fg=colour232,bg=colour111] #I #[fg=colour222,bg=colour235] #(echo '#{pane_current_path}' | rev | cut -d'/' -f-2 | rev) " - # # setw window-status-current-format "#[fg=colour232,bg=colour208] #I #[fg=colour255,bg=colour237] #(echo '#{pane_current_path}' | rev | cut -d'/' -f-2 | rev) " - # - # # --------=== Modes - # setw clock-mode-colour "${thm_blue}" - # setw mode-style "fg=${thm_pink} bg=${thm_black4} bold" } main "$@" From 6e5343e0976ee2a82039b841d25b6f02400fa6a7 Mon Sep 17 00:00:00 2001 From: Roger Steve Ruiz Date: Wed, 23 Nov 2022 20:40:45 -0500 Subject: [PATCH 09/11] =?UTF-8?q?Adding=20in=20the=20functionality;=20?= =?UTF-8?q?=F0=9F=8E=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch adds the functionality necessary to setup @catppuccin_window_tabs_enabled for folks who expect something differently than the initial design. --- catppuccin.tmux | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/catppuccin.tmux b/catppuccin.tmux index e13aef6..83748d8 100755 --- a/catppuccin.tmux +++ b/catppuccin.tmux @@ -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}" From 9395d48c49c63b76689f5fb17433586a17db2926 Mon Sep 17 00:00:00 2001 From: Roger Steve Ruiz Date: Wed, 23 Nov 2022 20:59:18 -0500 Subject: [PATCH 10/11] Decoupling show_* vars more from the set[w] files; This decoupling was done in a previous patch 0d82738708b647a24d1096a381a242d9ce2fa1d8 and I missed this. So I went back to fix it. --- catppuccin.tmux | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/catppuccin.tmux b/catppuccin.tmux index 83748d8..937d072 100755 --- a/catppuccin.tmux +++ b/catppuccin.tmux @@ -68,6 +68,10 @@ main() { 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 " + readonly show_directory_in_window_status="#[fg=$thm_bg,bg=$thm_blue] #I #[fg=$thm_fg,bg=$thm_gray] #{b:pane_current_path} " + readonly show_directory_in_window_status_current="#[fg=$thm_bg,bg=$thm_orange] #I #[fg=$thm_fg,bg=$thm_bg] #{b:pane_current_path} " + 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]#[fg=$thm_fg,bg=$thm_bg,nobold,nounderscore,noitalics] " + 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]#[fg=$thm_fg,bg=$thm_bg,nobold,nounderscore,noitalics] " # Right column 1 by default shows the Window name. local right_column1=$show_window @@ -76,16 +80,16 @@ main() { local right_column2=$show_session # Window status by default shows the current directory basename. - 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} " + 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="#[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] " + window_status_format=$show_window_in_window_status + window_status_current_format=$show_window_in_window_status_current fi set status-left "" From 110a068dbc27bbaf8f3b8011e1402bb71afb0273 Mon Sep 17 00:00:00 2001 From: Roger Steve Ruiz Date: Wed, 30 Nov 2022 00:02:19 -0500 Subject: [PATCH 11/11] Fix the path issue with the plugin directory --- catppuccin.tmux | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/catppuccin.tmux b/catppuccin.tmux index 937d072..47d06e9 100755 --- a/catppuccin.tmux +++ b/catppuccin.tmux @@ -1,5 +1,5 @@ #!/usr/bin/env bash -CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +PLUGIN_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" main() { get-tmux-option() { @@ -33,10 +33,10 @@ main() { # NOTE: Pulling in the selected theme by the theme that's being set as local # variables. sed -E 's/^(.+=)/local \1/' \ - > catppuccin-selected-theme.tmuxtheme \ - < "${CURRENT_DIR}/catppuccin-${theme}.tmuxtheme" + > "${PLUGIN_DIR}/catppuccin-selected-theme.tmuxtheme" \ + < "${PLUGIN_DIR}/catppuccin-${theme}.tmuxtheme" - source catppuccin-selected-theme.tmuxtheme + source "${PLUGIN_DIR}/catppuccin-selected-theme.tmuxtheme" # status set status "on"