tmux: Updated status bar

This commit is contained in:
2026-02-13 00:19:14 +01:00
parent 737890bb62
commit 3ef233942e

View File

@@ -12,14 +12,14 @@ set -g base-index 1
setw -g pane-base-index 1
# Increase the history limit (useful for longer command histories)
set-option -g history-limit 50000
set-option -g history-limit 10000
### Startup Configuration
# Attach to session "main" or create it if it doesn't exist
new-session -A -s main
# Start a new session named "main" if none exists
new-session -s main
# Start htop and split the window when the session "main" is created
set-hook -t main after-new-session 'send-keys -t main:1 "htop" C-m; split-window'
set-hook -t main session-created 'send-keys -t main:1 "sudo htop" C-m; split-window'
### Key Bindings
# Remap the prefix key from 'C-b' (Ctrl-b) to 'C-a' (Ctrl-a)
@@ -28,27 +28,27 @@ set-option -g prefix C-a
bind-key C-a send-prefix
# Split panes using 'h' for horizontal and 'v' for vertical splits
bind h split-window -h
bind v split-window -v
bind "h" split-window -h
bind "v" split-window -v
unbind '"'
unbind %
# Reload the tmux configuration file with 'r'
bind r source-file ~/.config/tmux/tmux.conf
bind r source-file $XDG_CONFIG_HOME/tmux/tmux.conf
### Clipboard Integration
# Enable clipboard via OSC 52 (works locally and over SSH/mosh)
# Enable clipboard
set -s set-clipboard on
set -ag terminal-overrides ',*:Ms=\E]52;c;%p2%s\7'
set -ag terminal-overrides ",*:Ms=\\E]52;c;%p2%s\\7"
# Vi-style copy mode
setw -g mode-keys vi
# Copy mode key bindings
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel ~/.config/tmux/yank.sh
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel ~/.config/tmux/yank.sh
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel ~/.config/tmux/yank.sh
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "$XDG_CONFIG_HOME/tmux/yank.sh"
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "$XDG_CONFIG_HOME/tmux/yank.sh"
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "$XDG_CONFIG_HOME/tmux/yank.sh"
### Status and Window Configuration
# Set the status bar update interval to 1 second
@@ -86,24 +86,41 @@ set -g status-left ''
# Set the maximum length for the left status
set -g status-left-length 30
## Session name in the status bar
set -ga status-left "#[bg=#444444,fg=white] #S "
# ## Session name in the status bar
# set -ga status-left "#[bg=#444444,fg=white] #S "
# Display different colors for the session name based on whether the prefix is active
set -ga status-left '#[fg=black]#{?client_prefix,#[bg=#ed8796] S ,#[bg=#a6da95] S }'
set -ga status-left '#[bg=#262626] '
# # Display different colors for the session name based on whether the prefix is active
# set -ga status-left '#[fg=black]#{?client_prefix,#[bg=#ed8796] S ,#[bg=#a6da95] S }'
# set -ga status-left '#[bg=#262626] '
# Set window status format to include the current directory or command
setw -g window-status-format '#[bg=#8787AF,fg=black] #I #[bg=#585B70,fg=white] #W #F '
# # Set window status format to include the current directory or command
# setw -g window-status-format '#[bg=#8787AF,fg=black] #I #[bg=#585B70,fg=white] #W #F '
# Set the current window status format to include the current directory or command
setw -g window-status-current-format '#[bg=#c6a0f6,fg=black] #I #[bg=#585B70,fg=white] #W #F '
# # Set the current window status format to include the current directory or command
# setw -g window-status-current-format '#[bg=#c6a0f6,fg=black] #I #[bg=#585B70,fg=white] #W #F '
# # Set the separator between window statuses
# set -g window-status-separator " "
# # Status bar right settings (display host information)
# set -g status-right "#[fg=black,bg=#7dc4e4] H #[fg=white,bg=brightblack] #H "
# # Set the maximum length for the right status
# set -g status-right-length 40
# Session name and prefix indicator (space always reserved to prevent content shift)
set -ga status-left '#[fg=#cdd6f4,bg=#313244] #S #[fg=#{?client_prefix,#f38ba8,#585b70}]● #[fg=#cdd6f4,bg=#1e1e2e] '
# Window tabs
setw -g window-status-format '#[fg=#cdd6f4,bg=#313244] #I: #W #[fg=#cdd6f4,bg=#1e1e2e] '
setw -g window-status-current-format '#[fg=#1e1e2e,bg=#cba6f7,bold] #I: #W #[fg=#cdd6f4,bg=#1e1e2e,nobold] '
# Set the separator between window statuses
set -g window-status-separator " "
set -g window-status-separator ''
# Status bar right settings (display host information, red when connected via SSH)
set -g status-right '#{?SSH_CONNECTION,#[fg=black bg=#fab387] SSH ,#[fg=black bg=#7dc4e4] H }#[fg=white,bg=brightblack] #H '
# Set the maximum length for the right status
set -g status-right-length 40
# Status bar right (H local / SSH remote)
set -g status-right ''
set -g status-right-length 50
set -ga status-right '#{?SSH_CONNECTION,#[fg=#1e1e2e#,bg=#fab387#,bold] SSH #[fg=#cdd6f4#,bg=#1e1e2e#,nobold] ,}'
set -ga status-right '#[fg=#1e1e2e,bg=#94e2d5,bold] #H #[fg=#cdd6f4,bg=#1e1e2e,nobold]'