From 588cf15d6858eec75389764d79f7c3bbb630fedf Mon Sep 17 00:00:00 2001 From: TheFlyingFool Date: Thu, 6 Mar 2025 14:42:52 -0600 Subject: [PATCH] two line tmux status bar --- .tmux.conf | 61 ++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 43 insertions(+), 18 deletions(-) diff --git a/.tmux.conf b/.tmux.conf index cb2090a..32f0ec8 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -1,11 +1,32 @@ -#Switch to screen prefix +# Switch to screen prefix +# Ctrl-a unbind C-b set -g prefix C-a bind-key b send-prefix + +set -g base-index 1 # start windows numbering at 1 +setw -g pane-base-index 1 # make pane numbering consistent with windows + +setw -g automatic-rename on # rename window to reflect current program +set -g renumber-windows on # renumber windows when a window is closed + +set -g set-titles on # set terminal title + + +## Commonly found settings not 100% sure on the point +setw -g monitor-activity on +set -g visual-activity on + #Double cntl-a goes to last window bind-key C-a last-window +# Turn on mouse support +set-option -g mouse on + +bind-key -n C-S-Left swap-pane -t :- +bind-key -n C-S-Right swap-pane -t :+ + #Cntl-a Backspace goes to previous window unbind BSpace bind BSpace previous-window @@ -15,30 +36,37 @@ bind % split-window -c "#{pane_current_path}" -h bind '"' split-window -c "#{pane_current_path}" -v bind c new-window -c "#{pane_current_path}" - #kill window/server with confirm bind-key k confirm kill-window bind-key K confirm kill-server -#Status bar -set -g status-bg cyan -set-option -g status-justify centre -#Left -set -g status-left-length 30 -set -g status-left '#[fg=blue]%H:%M %d-%b-%y' +# Status bar +# Enable two lines for the status bar +set-option -g status 2 +set-option -g status-position bottom +# First line: Center (Window List) +set-option -g status-format[0] '#[align=centre]#{W:#{E:window-status-format} ,#{E:window-status-current-format} }' -set -g status-right '#[fg=blue]#h #[fg=yellow]#(acpi -i)' +# Second line: Center (Time/Date, ACPI, CPU/Mem, Hostname) +set-option -g status-format[1] "#[align=centre][#[fg=cyan]%H:%M %d-%b-%y] [#[fg=yellow]#(acpi -b | awk -F', ' '{print $2, $3}')] [#[fg=green,bg=default,bright]#(tmux-mem-cpu-load)] [#[fg=blue]#h]" -#change numbering to start from 1 -set -g base-index 1 +# Ensure window list is properly justified +set-option -g status-justify centre # Changed to centre +# Background color for status bar (Blue) +set -g status-bg colour24 +set -g status-fg colour231 + +# Window list formatting +set-window-option -g window-status-format '#[fg=colour117,bg=colour24] #I:#W #[fg=colour24,bg=colour24]' +set-window-option -g window-status-current-format '#[fg=colour16,bg=colour231] #I:#W #[fg=colour24,bg=colour24]' # Bind function keys to windows bind -n F1 select-window -t 1 bind -n F2 select-window -t 2 -bind -n F3 select-window -t 3 +bind -n F3 select-window -t 3 bind -n F4 select-window -t 4 bind -n F5 select-window -t 5 bind -n F6 select-window -t 6 @@ -50,12 +78,13 @@ bind -n F10 select-window -t 10 #start programs new -s mysession -n "sys-mon" glances neww -n "Log" "journalctl -f" -neww +neww #neww -n "Music" ncmpcpp #neww -n "Deluge" deluge-console #reload tmux config bind R source-file ~/.tmux.conf \; display-message "Config reloaded..." +bind r source-file ~/.tmux.conf \; display-message "Config reloaded..." #vi keybindings set -g mode-keys vi @@ -77,8 +106,4 @@ bind F12 send-keys F12 # renumber windows after closing one set -g renumber-windows on - -#In order to use this file you can either -#####1. Put it in your home folder named .tmux.conf -##2. Add an alias in your bashrc (or the equivilent file for your shell) for tmux doing tmux -f /location/of/this/file -##3. Put this file in /etc/ named tmux.conf +set -g history-limit 50000 \ No newline at end of file