From 6bb75525ba14b4faf65acb062e83db2be0edbeba Mon Sep 17 00:00:00 2001 From: izumin5210 Date: Sun, 7 Apr 2024 14:38:35 +0900 Subject: [PATCH] use catppuccin colors on tmux --- config/.config/tmux/style.tmux | 58 +++++++++++++++++++++++++++++++++ config/.config/tmux/tmux.conf | 59 +++------------------------------- 2 files changed, 63 insertions(+), 54 deletions(-) create mode 100755 config/.config/tmux/style.tmux diff --git a/config/.config/tmux/style.tmux b/config/.config/tmux/style.tmux new file mode 100755 index 00000000..b90086ee --- /dev/null +++ b/config/.config/tmux/style.tmux @@ -0,0 +1,58 @@ +#!/usr/bin/env bash + +set -eu + +main() { + # from https://github.com/catppuccin/tmux/blob/5ed4e8a/catppuccin-frappe.tmuxtheme#L4-L17 + # --> Catppuccin (Frappe) + thm_bg="#303446" + thm_fg="#c6d0f5" + thm_cyan="#99d1db" + thm_black="#292c3c" + thm_gray="#414559" + thm_magenta="#ca9ee6" + thm_pink="#f4b8e4" + thm_red="#e78284" + thm_green="#a6d189" + thm_yellow="#e5c890" + thm_blue="#8caaee" + thm_orange="#ef9f76" + thm_black4="#626880" + + separator="#[fg=${thm_gray},bg=default,none]▕#[default]" + + tmux set -g message-command-style "align=right,fg=${thm_blue}" + tmux set -g message-style "align=right,fg=${thm_blue},align=centre" + tmux set -g pane-active-border-style "fg=${thm_black4}" + tmux set -g pane-border-style "fg=${thm_black}" + + # status bar + # ================================================ + tmux set -g status "on" + tmux set -g status-position "top" + tmux set -g status-justify "right" + tmux set -g status-style "none" + + # left panel + tmux set -g status-left-length 100 + tmux set -g status-left-style "none,fg=${thm_black4},align=right" + + show_git_repo_and_branch="cd #{pane_current_path} && git rev-parse --is-inside-work-tree >/dev/null 2>&1 && echo \"  \$(git info slug -s) ${separator}  \$(git info branch --max-len 24 --short) ${separator}\"" + # + tmux set -g status-left " #S ${separator} #(${show_git_repo_and_branch})" + + # right panel + tmux set -g status-right-style "none" + tmux set -g status-right "" + + # window + # ================================================ + tmux setw -g window-status-current-style "bold,fg=${thm_fg}" + tmux setw -g window-status-activity-style "none,fg=${thm_black4}" + tmux setw -g window-status-style "none,fg=${thm_black4}" + tmux setw -g window-status-current-format " #I #W ${separator}" + tmux setw -g window-status-format " #I #W ${separator}" + tmux setw -g window-status-separator "" +} + +main diff --git a/config/.config/tmux/tmux.conf b/config/.config/tmux/tmux.conf index 5f7c0f61..a5cbe4f7 100644 --- a/config/.config/tmux/tmux.conf +++ b/config/.config/tmux/tmux.conf @@ -11,69 +11,20 @@ if-shell "uname | grep -q Darwin" \ # appearance # ================================================ -set -g @colorBlack '#1e2132' -set -g @colorMaroon '#e27878' -set -g @colorGreen '#b4be82' -set -g @colorOlive '#e2a478' -set -g @colorNavy '#84a0c6' -set -g @colorPurple '#a093c7' -set -g @colorTeal '#89b8c2' -set -g @colorSilver '#c6c8d1' -set -g @colorGray '#6b7089' -set -g @colorRed '#e98989' -set -g @colorLime '#c0ca8e' -set -g @colorYellow '#e9b189' -set -g @colorBlue '#91acd1' -set -g @colorFuchsia '#ada0d3' -set -g @colorAqua '#95c4ce' -set -g @colorWhite '#d2d4de' - -set -g @separator '#[fg=#262a3f,bg=default,none]▕#[default]' - # 256色 set -g default-terminal "tmux-256color" # set -ag terminal-overrides ",alacritty:RGB" set -ag terminal-overrides ",xterm-256color:RGB" -set -g message-command-style "align=right,fg=#{@colorBlue}" -set -g message-style "align=right,fg=#{@colorBlue},align=centre" -set -g pane-active-border-style "fg=#{@colorGray}" -set -g pane-border-style "fg=#262a3f" - -# ================================================ -# status bar -# ================================================ - -set -g status "on" -set -g status-position "top" -set -g status-justify "right" -set -g status-style "none" - -# left panel -set -g status-left-length 100 -set -g status-left-style "none,fg=#{@colorGray},align=right" - -set -g status-left ' #S#[default] #{@separator} #(cd #{pane_current_path} && git rev-parse --is-inside-work-tree >/dev/null 2>&1 && echo "  $(git info slug -s) #{@separator}  $(git info branch --max-len 24 --short) #{@separator}")' - -# right panel -set -g status-right-style "none" -set -g status-right '' - -# refresh rate (default 15sec) -set -g status-interval 5 - -# window -setw -g window-status-current-style "bold,fg=#{@colorWhite}" -setw -g window-status-activity-style "none,fg=#{@colorGray}" -setw -g window-status-style "none,fg=#{@colorGray}" -setw -g window-status-current-format " #I #W #{@separator}" -setw -g window-status-format " #I #W #{@separator}" -setw -g window-status-separator "" - # enable visual notification set-window-option -g monitor-activity on set -g visual-activity on +# refresh rate (default 15sec) +tmux set -g status-interval 5 + +run "${XDG_CONFIG_HOME}/tmux/style.tmux" + # ================================================ # keybind # ================================================