From e601612535ea60f2bcb7e338428f1d48323a4e3f Mon Sep 17 00:00:00 2001 From: Fernando Schauenburg Date: Fri, 11 Dec 2020 18:03:22 +0100 Subject: [PATCH] feat(tmux): improve status line with more info & colors --- roles/tmux/files/tmux-colors.conf | 61 +++++++++++++++++++++++++------ roles/tmux/files/tmux.conf | 11 +----- 2 files changed, 51 insertions(+), 21 deletions(-) diff --git a/roles/tmux/files/tmux-colors.conf b/roles/tmux/files/tmux-colors.conf index c72d9b4..531f1d2 100644 --- a/roles/tmux/files/tmux-colors.conf +++ b/roles/tmux/files/tmux-colors.conf @@ -1,16 +1,55 @@ -# Default to solarized dark. -set -g status-fg colour3 # Yellow -set -g status-bg colour0 # Base02 -setw -g window-status-style fg=colour12,bg=default # Base0 on Transparent -setw -g window-status-current-style fg=colour9,bg=default # Orange on Transparent -set -g pane-border-style fg=colour0 # Base02 -set -g pane-active-border-style fg=colour14 # Base1 +set -g status-left-length 32 +set -g status-right-length 32 +set -g status-justify centre -%if #{==:#{BACKGROUND},light} - set -g status-fg colour13 # Violet - set -g status-bg colour7 # Base2 +# Color definitions +# SOLARIZED TMUX +# --------- -------- +# Base03 colour8 +# Base02 colour0 +# Base01 colour10 +# Base00 colour11 +# Base0 colour12 +# Base1 colour14 +# Base2 colour7 +# Base3 colour15 +# Yellow colour3 +# Orange colour9 +# Red colour1 +# Magenta colour5 +# Violet colour13 +# Blue colour4 +# Cyan colour6 +# Green colour2 + +set -g status-left "\ +#[fg=colour3]#{session_name} #{?client_prefix,#[fg=colour1],#[fg=colour10]}> \ +#[fg=colour2]#{window_index} #{window_name} #{?client_prefix,#[fg=colour1],#[fg=colour10]}> \ +#[fg=colour6]#{pane_index} #{pane_current_command} #{?client_prefix,#[fg=colour1],#[fg=colour10]} " + +set -g status-right "\ +#[fg=colour6]C #{client_pid} #{?client_prefix,#[fg=colour1],#[fg=colour10]}< \ +#[fg=colour2]S #{pid} #{?client_prefix,#[fg=colour1],#[fg=colour10]}< \ +#[fg=colour3]%b %d %H:%M " + +setw -g window-status-current-format " #{?client_prefix,#[fg=colour1],}#{window_index}:#{window_name}#{window_flags} " +setw -g window-status-format " #{window_index}:#{window_name}#{window_flags} " + +%if #{==:#{BACKGROUND},dark} + set -g status-style bg=colour0 # ... on Base02 + setw -g window-status-style fg=colour12,bg=default # Base0 on Transparent + setw -g window-status-current-style fg=colour4,bg=default # Blue on Transparent + set -g pane-border-style fg=colour0 # Base02 + set -g pane-active-border-style fg=colour14 # Base1 + set -g message-style fg=colour0,bg=colour14 + set -g message-command-style fg=colour0,bg=colour14 +%elif #{==:#{BACKGROUND},light} + set -g status-style fg=colour13,bg=colour7 # Violet on Base2 setw -g window-status-style fg=colour11,bg=default # Base00 on Transparent - setw -g window-status-current-style fg=colour5,bg=default # Magenta on Transparent + setw -g window-status-current-style fg=colour4,bg=default # Blue on Transparent set -g pane-border-style fg=colour7 # Base2 set -g pane-active-border-style fg=colour10 # Base01 + set -g message-style fg=colour7,bg=colour10 + set -g message-command-style fg=colour7,bg=colour10 %endif + diff --git a/roles/tmux/files/tmux.conf b/roles/tmux/files/tmux.conf index 54f0904..0d21333 100644 --- a/roles/tmux/files/tmux.conf +++ b/roles/tmux/files/tmux.conf @@ -38,22 +38,13 @@ setw -g automatic-rename on # automatically rename windows setw -g mouse on # enable mouse support setw -g pane-base-index 1 # start pane numbering from 1 -# -# Status bar -# -set -g status-left-length 32 -set -g status-right-length 32 -set -g status-justify centre -set -g status-left '@#h §#S' # @host §session -set -g status-right '%Y-%m-%d %H:%M' # date time - # The shell will increment SHLVL by one when it is started -> unsetting this # variable here removes any memory of nesting before tmux was executed and will # cause shells to start with level 1 again within the session. set-environment -gu SHLVL # -# Colors +# Style (status list, colors, ...) # source-file -q "$XDG_CONFIG_HOME/tmux/tmux-colors.conf"