From b874bdb8b643d11d0943f5dd5c2b1a6bd9a5489b Mon Sep 17 00:00:00 2001 From: TheFlyingFool Date: Thu, 15 May 2025 00:38:55 -0500 Subject: [PATCH] Tmux config added --- .config/tmux/tmux.conf | 117 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 .config/tmux/tmux.conf diff --git a/.config/tmux/tmux.conf b/.config/tmux/tmux.conf new file mode 100644 index 0000000..801d183 --- /dev/null +++ b/.config/tmux/tmux.conf @@ -0,0 +1,117 @@ +# tmux config + +# - Prefix Key - # +# Change prefix from C-b to C-a +unbind C-b +set -g prefix C-a + +# Send C-a to application (press C-a, then a) +bind-key a send-prefix + +# --- Window and Pane Numbering --- +# Start numbering at 1 +set -g base-index 1 +set-window-option -g pane-base-index 1 + +# --- Automatic Naming/Renumbering --- +# Rename window by program +set-window-option -g automatic-rename on +# Renumber windows on close +set -g renumber-windows on + +# --- Terminal Title --- +# Set terminal title +set -g set-titles on + +# --- Activity Monitoring --- +# Highlight window on activity +set-window-option -g monitor-activity on +set-option -g visual-activity on + +# --- Aggressive Resize (Potentially Redundant) --- +set-window-option -g aggressive-resize on +set-option -g automatic-rename on + +# --- Navigation --- +# Go to last window (C-a C-a) +bind-key C-a last-window + +# --- Mouse Support --- +set-option -g mouse on + +# --- Navigation (Continued) --- +# Go to previous window (C-a Backspace) +unbind BSpace +bind BSpace previous-window + +# --- Splitting and New Windows --- +# Split horizontal in current path (C-a %) +bind % split-window -c "#{pane_current_path}" -h +# Split vertical in current path (C-a ") +bind '"' split-window -c "#{pane_current_path}" -v +# New window in current path (C-a c) +bind c new-window -c "#{pane_current_path}" + +# --- Killing Windows/Server --- +# Kill window with confirm (C-a k) +bind-key k confirm kill-window +# Kill server with confirm (C-a K) +bind-key K confirm kill-server + +# 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} }' + +# Second line: Center (Time/Date, ACPI, CPU/Mem, Hostname) +set-option -g status-format[1] "#[align=centre]#[fg=red][Pending Updates: #(checkupdates | wc -l || echo "N/A")] #[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]" + +# 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]' + +#start programs +new -s mysession -n "sys-mon" glances +neww -n "Log" "journalctl -f" +# neww -n "Music" if-shell -b '[[ "$TERM" == "xterm-kitty" ]]' "rmpc" if-shell -b '[["$TERM" == " != "kitty" ]] "ncmpcpp" +# neww -n "ARA Server" "bash -c 'cd ~/Repos/homelab-ansible && export ARA_SETTINGS="/home/nick/Repos/homelab-ansible/.ara/server/settings.yaml" && source .venv/bin/activate && ara-manage runserver'" +# neww -n "Deluge" deluge-console +neww + +#reload tmux config +bind R source-file ~/.tmux.conf \; display-message "Config reloaded..." +bind r source-file ~/.tmux.conf \; display-message "Config reloaded..." + +# --- Function Keys --- +# F1-F12 send key to application +bind -n F1 send-keys F1 +bind -n F2 send-keys F2 +bind -n F3 send-keys F3 +bind -n F4 send-keys F4 +bind -n F5 send-keys F5 +bind -n F6 send-keys F6 +bind -n F7 send-keys F7 +bind -n F8 send-keys F8 +bind -n F9 send-keys F9 +bind -n F10 send-keys F10 +bind -n F11 send-keys F11 +bind -n F12 send-keys F12 + +# C-a F1-F10 switch windows +bind F1 select-window -t :=1 +bind F2 select-window -t :=2 +bind F3 select-window -t :=3 +bind F4 select-window -t :=4 +bind F5 select-window -t :=5 +bind F6 select-window -t :=6 +bind F7 select-window -t :=7 +bind F8 select-window -t :=8 +bind F9 select-window -t :=9 +bind F10 select-window -t :=10