tmate/examples/nicm-start-tmux.sh

54 lines
1.2 KiB
Bash
Raw Normal View History

2007-10-23 12:52:53 +02:00
#!/bin/sh -x
[ ! -z "$TMUX" ] && exit
2007-10-19 19:15:29 +02:00
SOCKET=/tmp/tmux-1000-main
TMUX="tmux -S $SOCKET"
2007-11-17 09:29:33 +01:00
if ! $TMUX -s0 has 2>/dev/null; then
2007-11-16 22:38:00 +01:00
# Session 0
$TMUX new -d -s0 -nyelena 'exec ssh yelena' # 0
2007-10-23 12:52:53 +02:00
2007-11-16 22:38:00 +01:00
# This needs to be set before starting shells...
$TMUX set default-command "exec $SHELL -l"
2007-10-23 12:52:53 +02:00
2007-11-16 22:38:00 +01:00
$TMUX -s0 neww -d -ntodo 'exec emacs ~/TODO' # 1
$TMUX -s0 neww -d -nncmpc # 2
$TMUX -s0 neww -d # 3
$TMUX -s0 neww -d # 4
$TMUX -s0 neww -d # 5
$TMUX -s0 neww -d # 6
$TMUX -s0 neww -d # 7
$TMUX -s0 neww -d # 8
$TMUX -s0 neww -d # 9
2007-10-19 19:15:29 +02:00
2007-11-17 09:28:48 +01:00
# Other sessions
for i in 1 2; do
# Window 0 is linked from session 0
$TMUX new -d -s$i
$TMUX -s$i linkw -dki0 0 0
$TMUX -s$i neww -d
$TMUX -s$i neww -d
done
2007-11-16 22:38:00 +01:00
# Rebind prefix key
2007-10-19 19:15:29 +02:00
$TMUX set prefix ^A
2007-10-19 19:23:43 +02:00
$TMUX unbind ^B
$TMUX bind ^A send-prefix
2007-11-16 22:38:00 +01:00
# Bind q,w,e to session 0,1,2. We need per-session toolbar colours!
$TMUX bind q switch 0
$TMUX bind Q switch 0
$TMUX bind w switch 1
$TMUX bind W switch 1
$TMUX bind e switch 2
$TMUX bind E switch 2
# No bells, thanks
2007-10-19 19:15:29 +02:00
$TMUX set bell-action none
fi
2007-10-25 19:44:25 +02:00
2007-11-16 22:38:00 +01:00
$TMUX -s0 attach -d