Run X before attempting to launch tmux

This commit is contained in:
The Magician 2024-04-10 14:54:52 +01:00
parent 86df65fc29
commit eb4ec29abc
1 changed files with 4 additions and 4 deletions

View File

@ -11,7 +11,7 @@ export TERM="xterm-256color"
export EDITOR="vi"
export VISUAL="vi"
export PATH="$PATH:$HOME/.local/bin/:$HOME/go/bin/"
export PATH="$PATH:$HOME/.local/bin/:$HOME/go/bin/:$HOME/bin/maltego_4.6.0/bin/"
export CDPATH=".:$HOME"
@ -72,10 +72,10 @@ md() {
mkdir -p "$1" && cd "$1" || return
}
# Automatically run X if this is a login tty
[[ "$(tty)" == "/dev/tty1" ]] && ! pgrep -x Xorg >/dev/null && startx
# Automatically run tmux if we aren't already in a session and there's no matching session already running
if [[ -z "$TMUX" ]] && ! tmux list-sessions 2>/dev/null | grep --quiet "$HOSTNAME"; then
tmux new -s "$HOSTNAME"
fi
# Automatically run X if this is a login tty
[[ "$(tty)" == "/dev/tty1" ]] && ! pgrep -x Xorg >/dev/null && startx