Skip to content

Instantly share code, notes, and snippets.

@CSpyridakis
Created April 15, 2025 14:38
Show Gist options
  • Select an option

  • Save CSpyridakis/0c2782d2f91f57a7d5d46ef5abf58dad to your computer and use it in GitHub Desktop.

Select an option

Save CSpyridakis/0c2782d2f91f57a7d5d46ef5abf58dad to your computer and use it in GitHub Desktop.
#!/usr/bin/tmux
# This is a minimal implementation of this repo:
# https://github.com/CSpyridakis/tmux-monitor-theme.git
# The original implementation requires extra dependencies and an additional
# script in order to work. This however, does not require anything else
# Change Prefix key
# ---------------------------------------------------------------------------------------
# set -g prefix C-a
# bind C-a send-prefix
# unbind C-b
# ---------------------------------------------------------------------------------------
# Misc
# ---------------------------------------------------------------------------------------
set -g mouse on
set -g default-terminal "screen-256color"
set -g base-index 1 # Pane numbering from 1
set -g allow-rename off # Disable autorenaming when you give a specific name to a pane
set-option -g renumber-windows on
bind r source-file ~/.tmux.conf \; display-message " Config successfully reloaded!" # <Bind key> + r : to reload conf
# ---------------------------------------------------------------------------------------
# Panes
# ---------------------------------------------------------------------------------------
# Split Panes
bind % split-window -h \; select-pane -T ''
bind | split-window -h \; select-pane -T ''
bind '"' split-window -v \; select-pane -T ''
bind - split-window -v \; select-pane -T ''
# Pane borders
# set -g pane-border-status bottom
# set -g pane-border-format "#[bold,fg=#dddddd,bg=#009aff]#T"
set -g pane-border-format "#[bold,fg=colour222]#T"
# Pane Navigation: use <Alt> + arrow keys to move to panes
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
# Move panes
bind j command-prompt -p "Join pane from window:" "join-pane -s '%%'"
bind s command-prompt -p "Send pane to window:" "join-pane -t '%%'"
bind b command-prompt -p "Swap pane with:" "swap-pane -s '${PANE_NUM}' -t '%%'"
# Pane names
bind / command-prompt -p "(rename-pane)" -I "#T" "select-pane -T '%%'" # Rename pane
bind u set pane-border-status # Make names visible
bind U set pane-border-status off # Make names invisible
# Sync panes
bind y set-window-option synchronize-panes\; display-message " Pane sync #{?pane_synchronized,ON,OFF}"
# ---------------------------------------------------------------------------------------
# Clock
# ---------------------------------------------------------------------------------------
set-window-option -g clock-mode-colour "#268bd2"
set-window-option -g clock-mode-style 12
# ---------------------------------------------------------------------------------------
# Windows
# ---------------------------------------------------------------------------------------
unbind C-c
bind c new-window \; select-pane -T ''
# Move around windows
bind-key -n C-S-Left select-window -t -1
bind-key -n C-S-Right select-window -t +1
# Reorder windows
bind-key -n C-S-Up swap-window -t -1\; select-window -t -1
bind-key -n C-S-Down swap-window -t +1\; select-window -t +1
set -g status-justify 'centre'
# set -g window-status-fg 'colour121'
# set -g window-status-attr 'none'
# setw -g window-status-bg 'colour235'
# setw -g window-status-activity-bg 'colour235'
# set -g window-status-activity-attr 'none'
# set -g window-status-activity-fg 'colour154'
set -g window-status-separator ''
setw -g window-status-format "#[fg=colour235,bg=colour235,nobold,nounderscore,noitalics]#[fg=white,bg=colour235]#I #W #[fg=colour235,bg=colour235,nobold,nounderscore,noitalics]"
setw -g window-status-current-format "#[fg=blue,bg=colour235,nobold,nounderscore,noitalics]#[fg=colour222,bg=blue] #I #{?window_zoomed_flag,_ ,}#W#{?window_zoomed_flag, _,} #[fg=blue,bg=colour235,nobold,nounderscore,noitalics]"
bind-key c new-window -n 'shell' # When create a new window set window name as empty
# ---------------------------------------------------------------------------------------
# Coloring Panes and Borders
# ---------------------------------------------------------------------------------------
non_active_pane_bg_clr="#232C2F" # 232C2F,
non_active_font_clr="#656565" # 656565,
active_pane_bg_clr="#2E3436" # 2E3436,
set -g pane-border-style "bg=$non_active_pane_bg_clr fg=white" # Non active border
set -g pane-active-border-style "bg=$active_pane_bg_clr fg=white" # Active border
set -g window-style "bg=$non_active_pane_bg_clr fg=$non_active_font_clr" # Non active pane
set -g window-active-style "bg=$active_pane_bg_clr fg=white" # Active pane
# ---------------------------------------------------------------------------------------
# Clipboard
# ---------------------------------------------------------------------------------------
# On Linux, this requires xclip to be installed
bind -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "xclip -i -f -selection primary | xclip -i -selection clipboard"
bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "xclip -i -f -selection primary | xclip -i -selection clipboard"
bind -T copy-mode-vi C-j send-keys -X copy-pipe-and-cancel "xclip -i -f -selection"
set-window-option -g mode-keys vi
# ---------------------------------------------------------------------------------------
# messages
# ---------------------------------------------------------------------------------------
set -g message-style 'fg=colour232 bg=blue bold'
# set -g message-fg 'colour222'
# set -g message-bg 'colour238'
# set -g message-command-fg 'colour222'
# set -g message-command-bg 'colour238'
# ---------------------------------------------------------------------------------------
# Status Bar
# ---------------------------------------------------------------------------------------
set -g status 'on'
set -g status-interval 1
set -g status-position bottom
# set -g status-utf8 'on'
set -g status-style "fg=white, bg=black"
set -g status-bg 'colour235'
set -g status-left-length '50'
set -g status-right-length '50'
# set -g status-right-attr 'none'
# set -g status-left-attr 'none'
# set -g status-attr 'none'
set -g status-left "#[fg=green,bold]#S #[fg=white] - #[fg=cyan]#(hostname -I | cut -d' ' -f1)"
set -g status-right "#[fg=yellow]%Y-%m-%d %H:%M | #[fg=magenta]#(whoami)"
# ---------------------------------------------------------------------------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment