From 9ea3a63d24042987c7b98f8685af394218bb18ef Mon Sep 17 00:00:00 2001 From: Michael Ochmann Date: Thu, 4 Nov 2021 16:16:15 +0100 Subject: [PATCH] added tmux auto attach for propeller --- .bashrc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.bashrc b/.bashrc index a556271..da27def 100644 --- a/.bashrc +++ b/.bashrc @@ -258,3 +258,10 @@ alias reload="source ~/.bashrc" alias editrc="vim ~/.bashrc && reload" alias shutdowncause="log show --predicate 'eventMessage contains \"Previous shutdown cause\"' --last 24h" alias gl="glab" + +# PROPELLER TMUX SSH +if [ -z "$TMUX" ] && [ $(dpkg-query -W -f='${Status}' tmux 2>/dev/null | grep -c "ok installed") -eq 1 ] && [ -n "$SSH_TTY" ] && [ -z "$NO_AUTO_TMUX" ] && [[ $- =~ i ]] + then + tmux attach-session -t $USER || tmux new-session -s $USER + exit +fi