From 97183fc51071fa9ff20da6c208c9922ec319b1df Mon Sep 17 00:00:00 2001 From: Josh Hsieh Date: Thu, 8 Sep 2022 10:29:55 +0800 Subject: [PATCH] feat: tpm (Tmux Plugin Manager) support (#2) Co-authored-by: Pocco81 Co-authored-by: Lokesh Krishna Co-authored-by: Pocco81 <58336662+Pocco81@users.noreply.github.com> Co-authored-by: vinnyA3 Co-authored-by: winston --- README.md | 14 +++++++ catppuccin-frappe.conf | 57 --------------------------- catppuccin-frappe.tmuxtheme | 71 ++++++++++++++++++++++++++++++++++ catppuccin-latte.conf | 57 --------------------------- catppuccin-latte.tmuxtheme | 71 ++++++++++++++++++++++++++++++++++ catppuccin-macchiato.conf | 57 --------------------------- catppuccin-macchiato.tmuxtheme | 71 ++++++++++++++++++++++++++++++++++ catppuccin-mocha.conf | 57 --------------------------- catppuccin-mocha.tmuxtheme | 71 ++++++++++++++++++++++++++++++++++ catppuccin.tmux | 23 +++++++++++ 10 files changed, 321 insertions(+), 228 deletions(-) delete mode 100644 catppuccin-frappe.conf create mode 100755 catppuccin-frappe.tmuxtheme delete mode 100644 catppuccin-latte.conf create mode 100755 catppuccin-latte.tmuxtheme delete mode 100644 catppuccin-macchiato.conf create mode 100755 catppuccin-macchiato.tmuxtheme delete mode 100644 catppuccin-mocha.conf create mode 100755 catppuccin-mocha.tmuxtheme create mode 100755 catppuccin.tmux diff --git a/README.md b/README.md index 5833634..259be2c 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,20 @@ ## Usage +### TPM +1. Install [TPM](https://github.com/tmux-plugins/tpm) +2. Add the Catppuccin plugin: +```bash +set -g @plugin 'catppuccin/tmux' +# ...alongside +set -g @plugin 'tmux-plugins/tpm' +``` +3. (Optional) Set your preferred flavour, it defaults to `"mocha"`: +```bash +set -g @catppuccin_flavour 'latte' # or frappe, macchiato, mocha +``` + +### Manual 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` diff --git a/catppuccin-frappe.conf b/catppuccin-frappe.conf deleted file mode 100644 index 260483f..0000000 --- a/catppuccin-frappe.conf +++ /dev/null @@ -1,57 +0,0 @@ -# NOTE: you can use vars with $ and ${} as long as the str is double quoted: "" -# WARNING: hex colors can't contain capital letters - -# --> Catppuccin (Frappe) -thm_bg="#232634" -thm_fg="#c6d0f5" -thm_cyan="#99d1db" -thm_black="#292c3c" -thm_gray="#51576d" -thm_magenta="#ca9ee6" -thm_pink="#f4b8e4" -thm_red="#e78284" -thm_green="#a6d189" -thm_yellow="#e5c890" -thm_blue="#8caaee" -thm_orange="#ef9f76" -thm_black4="#626880" - -# ----------------------------=== Theme ===-------------------------- - -# status -set -g status-position top -set -g status "on" -set -g status-bg "${thm_bg}" -set -g status-justify "left" -set -g status-left-length "100" -set -g status-right-length "100" - -# messages -set -g message-style fg="${thm_cyan}",bg="${thm_gray}",align="centre" -set -g message-command-style fg="${thm_cyan}",bg="${thm_gray}",align="centre" - -# panes -set -g pane-border-style fg="${thm_gray}" -set -g pane-active-border-style fg="${thm_blue}" - -# windows -setw -g window-status-activity-style fg="${thm_fg}",bg="${thm_bg}",none -setw -g window-status-separator "" -setw -g window-status-style fg="${thm_fg}",bg="${thm_bg}",none - -# --------=== Statusline - -set -g status-left "" -set -g 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 -g window-status-format "#[fg=$thm_bg,bg=$thm_blue] #I #[fg=$thm_fg,bg=$thm_gray] #{b:pane_current_path} " -setw -g 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 -g window-status-format "#[fg=colour232,bg=colour111] #I #[fg=colour222,bg=colour235] #(echo '#{pane_current_path}' | rev | cut -d'/' -f-2 | rev) " -# setw -g 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 -g clock-mode-colour "${thm_blue}" -setw -g mode-style "fg=${thm_pink} bg=${thm_black4} bold" diff --git a/catppuccin-frappe.tmuxtheme b/catppuccin-frappe.tmuxtheme new file mode 100755 index 0000000..6c3fc7b --- /dev/null +++ b/catppuccin-frappe.tmuxtheme @@ -0,0 +1,71 @@ +#!/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 + +# --> Catppuccin (Frappe) +thm_bg="#232634" +thm_fg="#c6d0f5" +thm_cyan="#99d1db" +thm_black="#292c3c" +thm_gray="#51576d" +thm_magenta="#ca9ee6" +thm_pink="#f4b8e4" +thm_red="#e78284" +thm_green="#a6d189" +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.conf b/catppuccin-latte.conf deleted file mode 100644 index 929a64d..0000000 --- a/catppuccin-latte.conf +++ /dev/null @@ -1,57 +0,0 @@ -# NOTE: you can use vars with $ and ${} as long as the str is double quoted: "" -# WARNING: hex colors can't contain capital letters - -# --> Catppuccin (Latte) -thm_bg="#dce0e8" -thm_fg="#4c4f69" -thm_cyan="#179299" -thm_black="#e6e9ef" -thm_gray="#bcc0cc" -thm_magenta="#ea76cb" -thm_pink="#8839ef" -thm_red="#d20f39" -thm_green="#40a02b" -thm_yellow="#df8e1d" -thm_blue="#1e66f5" -thm_orange="#fe640b" -thm_black4="#acb0be" - -# ----------------------------=== Theme ===-------------------------- - -# status -set -g status-position top -set -g status "on" -set -g status-bg "${thm_bg}" -set -g status-justify "left" -set -g status-left-length "100" -set -g status-right-length "100" - -# messages -set -g message-style fg="${thm_cyan}",bg="${thm_gray}",align="centre" -set -g message-command-style fg="${thm_cyan}",bg="${thm_gray}",align="centre" - -# panes -set -g pane-border-style fg="${thm_gray}" -set -g pane-active-border-style fg="${thm_blue}" - -# windows -setw -g window-status-activity-style fg="${thm_fg}",bg="${thm_bg}",none -setw -g window-status-separator "" -setw -g window-status-style fg="${thm_fg}",bg="${thm_bg}",none - -# --------=== Statusline - -set -g status-left "" -set -g 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 -g window-status-format "#[fg=$thm_bg,bg=$thm_blue] #I #[fg=$thm_fg,bg=$thm_gray] #{b:pane_current_path} " -setw -g 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 -g window-status-format "#[fg=colour232,bg=colour111] #I #[fg=colour222,bg=colour235] #(echo '#{pane_current_path}' | rev | cut -d'/' -f-2 | rev) " -# setw -g 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 -g clock-mode-colour "${thm_blue}" -setw -g mode-style "fg=${thm_pink} bg=${thm_black4} bold" diff --git a/catppuccin-latte.tmuxtheme b/catppuccin-latte.tmuxtheme new file mode 100755 index 0000000..1ddb188 --- /dev/null +++ b/catppuccin-latte.tmuxtheme @@ -0,0 +1,71 @@ +#!/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 + +# --> Catppuccin (Latte) +thm_bg="#dce0e8" +thm_fg="#4c4f69" +thm_cyan="#179299" +thm_black="#e6e9ef" +thm_gray="#bcc0cc" +thm_magenta="#ea76cb" +thm_pink="#8839ef" +thm_red="#d20f39" +thm_green="#40a02b" +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.conf b/catppuccin-macchiato.conf deleted file mode 100644 index d28a093..0000000 --- a/catppuccin-macchiato.conf +++ /dev/null @@ -1,57 +0,0 @@ -# NOTE: you can use vars with $ and ${} as long as the str is double quoted: "" -# WARNING: hex colors can't contain capital letters - -# --> Catppuccin (Macchiato) -thm_bg="#181926" -thm_fg="#cad3f5" -thm_cyan="#91d7e3" -thm_black="#1e2030" -thm_gray="#494d64" -thm_magenta="#c6a0f6" -thm_pink="#f5bde6" -thm_red="#ed8796" -thm_green="#a6da95" -thm_yellow="#eed49f" -thm_blue="#8aadf4" -thm_orange="#f5a97f" -thm_black4="#5b6078" - -# ----------------------------=== Theme ===-------------------------- - -# status -set -g status-position top -set -g status "on" -set -g status-bg "${thm_bg}" -set -g status-justify "left" -set -g status-left-length "100" -set -g status-right-length "100" - -# messages -set -g message-style fg="${thm_cyan}",bg="${thm_gray}",align="centre" -set -g message-command-style fg="${thm_cyan}",bg="${thm_gray}",align="centre" - -# panes -set -g pane-border-style fg="${thm_gray}" -set -g pane-active-border-style fg="${thm_blue}" - -# windows -setw -g window-status-activity-style fg="${thm_fg}",bg="${thm_bg}",none -setw -g window-status-separator "" -setw -g window-status-style fg="${thm_fg}",bg="${thm_bg}",none - -# --------=== Statusline - -set -g status-left "" -set -g 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 -g window-status-format "#[fg=$thm_bg,bg=$thm_blue] #I #[fg=$thm_fg,bg=$thm_gray] #{b:pane_current_path} " -setw -g 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 -g window-status-format "#[fg=colour232,bg=colour111] #I #[fg=colour222,bg=colour235] #(echo '#{pane_current_path}' | rev | cut -d'/' -f-2 | rev) " -# setw -g 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 -g clock-mode-colour "${thm_blue}" -setw -g mode-style "fg=${thm_pink} bg=${thm_black4} bold" diff --git a/catppuccin-macchiato.tmuxtheme b/catppuccin-macchiato.tmuxtheme new file mode 100755 index 0000000..cdaaa89 --- /dev/null +++ b/catppuccin-macchiato.tmuxtheme @@ -0,0 +1,71 @@ +#!/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 + +# --> Catppuccin (Macchiato) +thm_bg="#181926" +thm_fg="#cad3f5" +thm_cyan="#91d7e3" +thm_black="#1e2030" +thm_gray="#494d64" +thm_magenta="#c6a0f6" +thm_pink="#f5bde6" +thm_red="#ed8796" +thm_green="#a6da95" +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.conf b/catppuccin-mocha.conf deleted file mode 100644 index be886c0..0000000 --- a/catppuccin-mocha.conf +++ /dev/null @@ -1,57 +0,0 @@ -# NOTE: you can use vars with $ and ${} as long as the str is double quoted: "" -# WARNING: hex colors can't contain capital letters - -# --> Catppuccin (Mocha) -thm_bg="#11111b" -thm_fg="#cdd6f4" -thm_cyan="#89dceb" -thm_black="#181825" -thm_gray="#45475a" -thm_magenta="#cba6f7" -thm_pink="#f5c2e7" -thm_red="#f38ba8" -thm_green="#a6e3a1" -thm_yellow="#f9e2af" -thm_blue="#89b4fa" -thm_orange="#fab387" -thm_black4="#585b70" - -# ----------------------------=== Theme ===-------------------------- - -# status -set -g status-position top -set -g status "on" -set -g status-bg "${thm_bg}" -set -g status-justify "left" -set -g status-left-length "100" -set -g status-right-length "100" - -# messages -set -g message-style fg="${thm_cyan}",bg="${thm_gray}",align="centre" -set -g message-command-style fg="${thm_cyan}",bg="${thm_gray}",align="centre" - -# panes -set -g pane-border-style fg="${thm_gray}" -set -g pane-active-border-style fg="${thm_blue}" - -# windows -setw -g window-status-activity-style fg="${thm_fg}",bg="${thm_bg}",none -setw -g window-status-separator "" -setw -g window-status-style fg="${thm_fg}",bg="${thm_bg}",none - -# --------=== Statusline - -set -g status-left "" -set -g 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 -g window-status-format "#[fg=$thm_bg,bg=$thm_blue] #I #[fg=$thm_fg,bg=$thm_gray] #{b:pane_current_path} " -setw -g 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 -g window-status-format "#[fg=colour232,bg=colour111] #I #[fg=colour222,bg=colour235] #(echo '#{pane_current_path}' | rev | cut -d'/' -f-2 | rev) " -# setw -g 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 -g clock-mode-colour "${thm_blue}" -setw -g mode-style "fg=${thm_pink} bg=${thm_black4} bold" diff --git a/catppuccin-mocha.tmuxtheme b/catppuccin-mocha.tmuxtheme new file mode 100755 index 0000000..e8178ec --- /dev/null +++ b/catppuccin-mocha.tmuxtheme @@ -0,0 +1,71 @@ +#!/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 + +# --> Catppuccin (Mocha) +thm_bg="#11111b" +thm_fg="#cdd6f4" +thm_cyan="#89dceb" +thm_black="#181825" +thm_gray="#45475a" +thm_magenta="#cba6f7" +thm_pink="#f5c2e7" +thm_red="#f38ba8" +thm_green="#a6e3a1" +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" + +# --------=== 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.tmux b/catppuccin.tmux new file mode 100755 index 0000000..928321f --- /dev/null +++ b/catppuccin.tmux @@ -0,0 +1,23 @@ +#!/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 + echo "$default" + fi +} + +main() { + local theme + theme="$(get-tmux-option "@catppuccin_flavour" "mocha")" + tmux run -b "$CURRENT_DIR/catppuccin-${theme}.tmuxtheme" +} + +main "$@"