1
0
mirror of https://github.com/balkian/dotfiles.git synced 2024-11-24 05:02:29 +00:00
dotfiles/starttmux
J. Fernando Sánchez 7bbcb17419 Several improvements.
* Tmux is not started by default anymore
* Added functions for i3 - Awesome!!
* zsh to start tmux
2013-07-12 19:19:52 +02:00

18 lines
566 B
Bash
Executable File

#!/bin/zsh
# TMUX
# if [[ -z "$KONSOLE_DBUS_SERVICE" & `which tmux` ]]; then
# if no session is started, start a new session
if [[ -n $(which tmux) ]]; then
stty -ixon
if [ ! -z "$SSH_AUTH_SOCK" -a "$SSH_AUTH_SOCK" != "$HOME/.ssh/ssh_auth_sock" ] ; then
unlink "$HOME/.ssh/ssh_auth_sock" 2>/dev/null
ln -s "$SSH_AUTH_SOCK" "$HOME/.ssh/ssh_auth_sock"
export SSH_AUTH_SOCK="$HOME/.ssh/ssh_auth_sock"
fi
test -z ${TMUX} && tmux attach
# when quitting tmux, try to attach
if [[ -z ${TMUX} ]]; then
exit;
fi
fi