Adding a refactor to dedicated files instead of a massive header
This commit is contained in:
18
EtcFiles/profile.d/shadowarch-session.sh
Normal file
18
EtcFiles/profile.d/shadowarch-session.sh
Normal file
@@ -0,0 +1,18 @@
|
||||
# Set up screen/tmux safety nest by default for remote sessions
|
||||
if [ -n "$SSH_CLIENT" ]; then
|
||||
# Prefer tmux
|
||||
if [ -x "$(which tmux 2>/dev/null)" ] && [ -z "$TMUX" ]; then
|
||||
if [ `tmux list-sessions | grep created | wc -l` -eq 0 ]; then
|
||||
exec tmux
|
||||
elif [ `tmux list-sessions | grep created | wc -l` -eq 1 ] && [ `tmux list-sessions | grep attached | wc -l` -eq 0 ]; then
|
||||
exec tmux a -d -t `tmux list-sessions | grep created | cut -f 1 -d ':'`
|
||||
else
|
||||
tmux list-sessions
|
||||
fi
|
||||
alias tat="exec tmux a -d -t"
|
||||
fi;
|
||||
|
||||
### XFCE4 ###
|
||||
elif [ `who -m | egrep "^$(whoami)" | awk '{ print $2; }' | egrep -c "^tty"` -eq 1 ] && [ -x /usr/sbin/startxfce4 ] && [ `pgrep -ac xinit` -eq 0 ] && [ `whoami` != 'root' ]; then
|
||||
exec startxfce4
|
||||
fi
|
||||
Reference in New Issue
Block a user