bashrc/.bashrc.d/99-autostart.bashrc

21 lines
641 B
Plaintext
Raw Normal View History

2023-03-18 12:49:08 +01:00
#!/usr/bin/env bash
# ~/.bashrc: executed by bash(1) for non-login shells.
# ==============================
# AUTOSTART
# ==============================
# run tmux if TMUX variable is null
if [[ "${TERM-}" != tmux* ]] && [[ -z "${TMUX}" ]] && [[ -z "${SSH_CONNECTION}" ]]; then
tmuxa
elif [[ -z "${TMUX}" ]] && [[ -n "${SSH_CONNECTION}" ]]; then
tmuxs
fi
# run MOTD at login only in an ssh session
if [[ -n "${TMUX}" ]] && [[ -n "${SSH_CONNECTION}" ]] && [[ "${SSH_MOTD-}" == 1 ]] && [[ -f "/etc/update-motd.d/00-motdfetch" ]]; then
motd
else
# use function pgdown to get the prompt to terminal window bottom
pgdown
fi