Skip to content
This repository has been archived by the owner on Jan 14, 2025. It is now read-only.

Commit

Permalink
Tmux setup
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolas Lamirault <[email protected]>
  • Loading branch information
nlamirault committed Aug 25, 2015
0 parents commit 73064d6
Show file tree
Hide file tree
Showing 2 changed files with 172 additions and 0 deletions.
36 changes: 36 additions & 0 deletions tmux-portefaix.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash

DIR=$1
SESSION="portefaix"

echo $#
if [ $# -eq 0 ]; then
echo "Usage: $0 <directory>"
exit 0
fi

function tmux_portefaix {
cd $DIR
tmux start-server
tmux new-session -s $SESSION -n Lam -d
tmux new-window -n "dot"
tmux send-keys -t $SESSION "cd $DIR/portefaix-dotfiles/" C-m
tmux new-window -n "Hyperion"
tmux send-keys -t $SESSION "cd $DIR/hyperion" C-m
tmux new-window -n "Hyperion-Services"
tmux send-keys -t $SESSION "cd $DIR/hyperion-services" C-m
tmux new-window -n "Base"
tmux send-keys -t $SESSION "cd $DIR/docker-base" C-m
tmux new-window -n "Elasticsearch"
tmux send-keys -t $SESSION "cd $DIR/docker-elasticsearch" C-m
tmux new-window -n "Kibana"
tmux send-keys -t $SESSION "cd $DIR/docker-kibana" C-m
tmux new-window -n "Grafana"
tmux send-keys -t $SESSION "cd $DIR/docker-grafana" C-m
tmux new-window -n "InfluxDB"
tmux send-keys -t $SESSION "cd $DIR/docker-influxdb" C-m

tmux attach-session -t $SESSION
}

tmux_portefaix
136 changes: 136 additions & 0 deletions tmux.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
# ~/.tmux.conf - tmux terminal multiplexer config


# set prefix key to ctrl+a until I have time to adapt
#unbind C-b
#set -g prefix C-a

# send the prefix to client inside window (ala nested sessions)
#bind-key a send-prefix

# toggle last window like screen
#bind-key C-a last-window

# confirm before killing a window or the server
bind-key k confirm kill-window
bind-key K confirm kill-server

# toggle statusbar
#bind-key b set-option status

# ctrl+left/right cycles thru windows
bind-key -n C-right next
bind-key -n C-left prev

bind-key M-j resize-pane -D
bind-key M-k resize-pane -U
bind-key M-h resize-pane -L
bind-key M-l resize-pane -R

# open a man page in new window
#bind / command-prompt "split-window 'exec man %%'"

# quick view of processes
#bind '~' split-window "exec htop"

# scrollback buffer n lines
set -g history-limit 5000

# listen for activity on all windows
set -g bell-action any

# on-screen time for display-panes in ms
set -g display-panes-time 2000

# start window indexing at one instead of zero
set -g base-index 1

# enable wm window titles
set -g set-titles on

# wm window title string (uses statusbar variables)
set -g set-titles-string "tmux.#I.#W"

# session initialization
#new -s mysession mutt
#neww -t 2
#neww -d -t 3
#neww -d -t 5 mocp
#neww -d -t 6 rtorrent
#selectw -t 1

# statusbar --------------------------------------------------------------

set -g display-time 2000
set -g status-attr default

# default statusbar colors
# set -g status-fg white
# set -g status-bg default

# default window title colors
# set-window-option -g window-status-fg cyan
# set-window-option -g window-status-bg default
# set-window-option -g window-status-attr dim

# active window title colors
# set-window-option -g window-status-current-fg white
# set-window-option -g window-status-current-bg default
# set-window-option -g window-status-current-attr bright

# command/message line colors
# set -g message-fg white
# set -g message-bg black
# set -g message-attr bright

# center align the window list
# set -g status-justify centre

# show some useful stats but only when tmux is started
# outside of Xorg, otherwise dwm statusbar shows these already
# set -g status-right ""
# set -g status-left ""
# if '[ -z "$DISPLAY" ]' 'set -g status-left "[#[fg=green] #H #[default]]"'
# if '[ -z "$DISPLAY" ]' 'set -g status-right "[ #[fg=magenta]#(cat /proc/loadavg | cut -d \" \" -f 1,2,3)#[default] ][ #[fg=cyan,bright]%a %Y-%m-%d %H:%M #[default]]"'
# if '[ -z "$DISPLAY" ]' 'set -g status-right-length 50'

#
# Help for colors in bash:
#
# $ for i in {0..255} ; do
# printf "\x1b[38;5;${i}mcolour${i}\n"
# done
#
# $ printf "\x1b[38;5;114mcolour114\n"


set-option -g default-shell "/usr/bin/bash"
# set-option -g default-shell "/usr/bin/fish"

# Theme

set-option -g status-bg black
set-option -g status-fg blue

set -g status-justify "centre"
set -g status "on"
set -g status-left-style "none"
set -g message-command-style "fg=colour214,bg=colour237"
set -g status-right-style "none"
set -g pane-active-border-style "fg=colour27"
set -g status-utf8 "on"
set -g status-style "bg=colour234,none"
set -g message-style "fg=colour214,bg=colour237"
set -g pane-border-style "fg=colour237"
set -g status-right-length "100"
set -g status-left-length "100"
setw -g window-status-activity-attr "none"
setw -g window-status-activity-style "fg=colour27,bg=colour234,none"
setw -g window-status-separator ""
setw -g window-status-style "fg=colour39,bg=colour234,none"
set -g status-left "#[fg=colour15,bg=colour27] #S #[fg=colour27,bg=colour234,nobold,nounderscore,noitalics]"
set -g status-right "#[fg=colour27,bg=colour234,nobold,nounderscore,noitalics]#[fg=colour15,bg=colour27] #h "
# set -g status-right "#[fg=colour237,bg=colour234,nobold,nounderscore,noitalics]#[fg=colour214,bg=colour237] %d.%m.%Y  %H:%M #[fg=colour27,bg=colour237,nobold,nounderscore,noitalics]#[fg=colour15,bg=colour27] #h "
setw -g window-status-format "#[fg=colour39,bg=colour234] #I #[fg=colour39,bg=colour234] #W "
setw -g window-status-current-format "#[fg=colour234,bg=colour237,nobold,nounderscore,noitalics]#[fg=colour214,bg=colour237] #I #[fg=colour214,bg=colour237] #W #[fg=colour237,bg=colour234,nobold,nounderscore,noitalics]"

0 comments on commit 73064d6

Please sign in to comment.