blob: d7f1d2027ac2fbdc39eca8d17f9979abf66e0423 (
plain) (
tree)
|
|
# Only if shell is interactive
case $- in
*i*) ;;
*) return ;;
esac
# Only if not in a tmux window
[ -z "$TMUX" ] || return
# Only if ~/.welcome/fortune exists and ~/.hushlogin doesn't
[ -e "$HOME"/.welcome/fortune ] || return
! [ -e "$HOME"/.hushlogin ] || return
# Only if fortune(6) available
command -v fortune >/dev/null 2>&1 || return
# Print from subshell to keep namespace clean
(
[ -d "$HOME"/.local/share/games/fortunes ] &&
: "${FORTUNE_PATH:="$HOME"/.local/share/games/fortunes}"
fortune -s "$FORTUNE_PATH"
printf '\n'
)
|