You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
dotfiles/starttmux

18 lines
566 B
Bash

#!/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