update tmux scopes
This commit is contained in:
parent
7694d6bd6f
commit
f41365f915
4
.bashrc
4
.bashrc
|
@ -13,10 +13,10 @@ chmod 600 ~/.bashrc ~/.bashrc.d/*
|
|||
# check if we are already in a Tmux session or open/attach the default one
|
||||
if [[ "${TERM-}" != tmux* ]] && [[ -z "${TMUX}" ]] && [[ -z "${SSH_CONNECTION}" ]] && command -v tmux 1> /dev/null; then
|
||||
# open/attach the local default Tmux session
|
||||
systemd-run -q --scope --user --unit tmux-session-local tmux new-session -A -s local && exit
|
||||
systemd-run -q --scope --user tmux new-session -A -s local && exit
|
||||
elif [[ -z "${TMUX}" ]] && [[ -n "${SSH_CONNECTION}" ]] && command -v tmux 1> /dev/null; then
|
||||
# open/attach the SSH default Tmux session
|
||||
systemd-run -q --scope --user --unit tmux-session-ssh tmux new-session -A -s ssh && exit
|
||||
systemd-run -q --scope --user tmux new-session -A -s ssh && exit
|
||||
fi
|
||||
|
||||
# if Tmux is not installed or if we are inside a Tmux session continue the sourcing
|
||||
|
|
|
@ -134,13 +134,13 @@ fi
|
|||
# SSH and ET with MOTD
|
||||
alias sshmotd='ssh -o SetEnv=SSH_MOTD=1'
|
||||
if command -v et 1> /dev/null; then
|
||||
alias etmotd='et --ssh-option SetEnv=SSH_MOTD=1'
|
||||
alias etmotd='et --ssh-option SetEnv=SSH_MOTD=1'
|
||||
fi
|
||||
|
||||
# open/attach to a default tmux session named local or ssh
|
||||
if command -v tmux 1> /dev/null; then
|
||||
alias tmux-local='systemd-run -q --scope --user --unit tmux-session-local tmux new-session -A -s local && exit'
|
||||
alias tmux-ssh='systemd-run -q --scope --user --unit tmux-session-ssh tmux new-session -A -s ssh && exit'
|
||||
alias tmux-local='systemd-run -q --scope --user tmux new-session -A -s local && exit'
|
||||
alias tmux-ssh='systemd-run -q --scope --user tmux new-session -A -s ssh && exit'
|
||||
fi
|
||||
|
||||
# vifm: tui file explorer
|
||||
|
|
Loading…
Reference in a new issue