diff options
author | Alexander Sulfrian <alexander.sulfrian@fu-berlin.de> | 2014-04-14 20:29:32 +0200 |
---|---|---|
committer | Alexander Sulfrian <alexander.sulfrian@fu-berlin.de> | 2014-04-14 20:29:32 +0200 |
commit | 787a747f6f374434890e73430fae9899d76c38e5 (patch) | |
tree | 60030b80cb7d4fc24a34b69582247f35f01c1300 | |
parent | 77f576af6fa9670120a9ed957729ec739cae408c (diff) | |
download | dotfiles-787a747f6f374434890e73430fae9899d76c38e5.tar.gz dotfiles-787a747f6f374434890e73430fae9899d76c38e5.tar.xz dotfiles-787a747f6f374434890e73430fae9899d76c38e5.zip |
tmux: config and socket in dofiles directory
-rwxr-xr-x | bashrc/bin/t | 33 | ||||
-rw-r--r-- | symlink-mapping | 1 | ||||
-rw-r--r-- | tmux/tmux.conf (renamed from tmux.conf) | 0 |
3 files changed, 29 insertions, 5 deletions
diff --git a/bashrc/bin/t b/bashrc/bin/t index 019eda9..3919af4 100755 --- a/bashrc/bin/t +++ b/bashrc/bin/t @@ -1,12 +1,37 @@ #!/usr/bin/env bash +real_tmux() { + if [ -f "${HOME}/.dotfiles/tmux/tmux.conf" ]; then + \tmux -f "${HOME}/.dotfiles/tmux/tmux.conf" -S "${HOME}/.dotfiles/tmux/socket" "$@" + else + \tmux "$@" + fi +} + +exec_real_tmux() { + if [ -f "${HOME}/.dotfiles/tmux/tmux.conf" ]; then + exec \tmux -f "${HOME}/.dotfiles/tmux/tmux.conf" -S "${HOME}/.dotfiles/tmux/socket" "$@" + else + exec \tmux "$@" + fi +} + + if [[ "x$1" == x ]] ; then - \tmux list-sessions || + real_tmux list-sessions || { - \tmux new-session -d + real_tmux new-session -d } - exec \tmux attach-session -d + exec_real_tmux attach-session -d +fi + +if [ -z "$2" -a "$1" != "att" -a "$1" != "ls" ]; then + if teal_tmux has-session -t "$1"; then + exec exec_real_tmux attach-session -t "$1" + else + exec exec_real_tmux new-session -s "$1" + fi fi -exec \tmux $@ +exec_real_tmux $@ diff --git a/symlink-mapping b/symlink-mapping index e773e06..801f369 100644 --- a/symlink-mapping +++ b/symlink-mapping @@ -8,4 +8,3 @@ .bash -> bashrc .mplayer -> mplayer .emacs.d -> emacs.d -.tmux.conf -> tmux.conf diff --git a/tmux.conf b/tmux/tmux.conf index 75b71a4..75b71a4 100644 --- a/tmux.conf +++ b/tmux/tmux.conf |