diff options
Diffstat (limited to 'sh/profile.d/welcome.sh')
-rw-r--r-- | sh/profile.d/welcome.sh | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/sh/profile.d/welcome.sh b/sh/profile.d/welcome.sh deleted file mode 100644 index 22cdde93..00000000 --- a/sh/profile.d/welcome.sh +++ /dev/null @@ -1,49 +0,0 @@ -# Only if shell is interactive -case $- in - *i*) ;; - *) return ;; -esac - -# Only if not in a tmux window -[ -z "$TMUX" ] || return - -# Not if ~/.hushlogin exists -[ -e "$HOME"/.hushlogin ] && return - -# Run all of this in a subshell to clear it away afterwards -( - # Temporary helper function - welcome() { - [ -e "$HOME"/.welcome/"$1" ] || return - command -v "$1" >/dev/null 2>&1 || return - } - - # Show a fortune - if welcome fortune ; then - if [ -z "$FORTUNE_PATH" ] && - [ -d "$HOME"/.local/share/games/fortunes ] ; then - FORTUNE_PATH=$HOME/.local/share/games/fortunes - fi - fortune -s "$FORTUNE_PATH" - printf '\n' - fi - - # Print today's reminders with asterisks - if welcome rem ; then - rem -hq | sed 's/^/* /' - printf '\n' - fi - - # Run verse(1) if we haven't seen it already today - if welcome verse ; then - if [ -f "$HOME"/.verse ] ; then - read -r last <"$HOME"/.verse - fi - now=$(date +%Y%m%d) - if [ "$now" -gt "${last:-0}" ] ; then - verse - printf '\n' - printf '%s\n' "$now" >"$HOME"/.verse - fi - fi -) |