Skip to content

Commit

Permalink
Merge pull request #306 from izumin5210/izumin5210/tmux-colors
Browse files Browse the repository at this point in the history
use catppuccin colors on tmux
  • Loading branch information
izumin5210 authored Apr 7, 2024
2 parents 0633421 + 6bb7552 commit 480f322
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 54 deletions.
58 changes: 58 additions & 0 deletions config/.config/tmux/style.tmux
Original file line number Diff line number Diff line change
@@ -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
59 changes: 5 additions & 54 deletions config/.config/tmux/tmux.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
# ================================================
Expand Down

0 comments on commit 480f322

Please sign in to comment.