Skip to content

Instantly share code, notes, and snippets.

@aleszoulek
Created May 5, 2011 21:25
Show Gist options
  • Save aleszoulek/957995 to your computer and use it in GitHub Desktop.
Save aleszoulek/957995 to your computer and use it in GitHub Desktop.
tmux conf
#!/bin/bash
SESSION=main
tmux="tmux -2"
# if the session is already running, just attach to it.
$tmux has-session -t $SESSION
if [ $? -eq 0 ]; then
echo "Session $SESSION already exists. Attaching."
sleep 1
$tmux attach -t $SESSION
exit 0;
fi
# create a new session, named $SESSION, and detach from it
$tmux new-session -d -s $SESSION
$tmux new-window -t $SESSION:0 -k -n jab mcabber
$tmux new-window -t $SESSION:1 -k -n irc irssi
$tmux new-window -t $SESSION:2 -k -n mp3 ncmpc
$tmux new-window -t $SESSION:3
$tmux new-session -d -s "root"
$tmux new-window -t "root:0" -k "sudo su -"
$tmux new-window -t "root:1" -k "sudo su -"
$tmux new-session -d -s "ssh"
$tmux new-window -t "ssh:0"
$tmux select-window -t $SESSION:3
$tmux attach -t $SESSION
# Set screen-like escape seq
set -g prefix C-a
# Pane bindings
bind | split-window -h
bind _ split-window -v
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Basic window movements
bind space next-window
bind-key C-a last-window
# Colors in status bar
set-window-option -g window-status-alert-attr blink
set-window-option -g window-status-alert-bg colour88
set-window-option -g window-status-alert-fg white
set-window-option -g window-status-current-fg red
set -g status-bg default
set -g status-fg yellow
set -g status-left '#[fg=green][ #S ]'
set -g status-right '#[fg=green][%a] %d.%m.%Y %T'
# Reload status every second
set -g status-interval 1
# Window titles
set-window-option -g automatic-rename on
set-option -g set-titles off
# History buffer should be loooooong
set -g history-limit 100000
# keep tmux msgs around longer
set -g display-time 3000
# locking
set-option -g lock-command vlock
bind x lock-session
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment