diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2016-08-20 00:43:35 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2016-08-20 01:21:09 +1200 |
commit | 1ce0e2ad424bf38768094488774eff23b3871ccc (patch) | |
tree | b9d407b2fb7729456ce554d4d610a194447ad737 /sh/profile.d/remind.sh | |
parent | Use terser shell for executable installs (diff) | |
download | dotfiles-1ce0e2ad424bf38768094488774eff23b3871ccc.tar.gz dotfiles-1ce0e2ad424bf38768094488774eff23b3871ccc.zip |
Port all bash_profile.d scripts to POSIX sh
Also require flag files in ~/.welcome for displaying or not displaying
login stuff
Diffstat (limited to 'sh/profile.d/remind.sh')
-rw-r--r-- | sh/profile.d/remind.sh | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/sh/profile.d/remind.sh b/sh/profile.d/remind.sh new file mode 100644 index 00000000..3ef0f353 --- /dev/null +++ b/sh/profile.d/remind.sh @@ -0,0 +1,19 @@ +# Only if shell is interactive +case $- in + *i*) ;; + *) return ;; +esac + +# Only if not in a tmux window +[ -z "$TMUX" ] || return + +# Only if ~/.welcome/remind exists and ~/.hushlogin doesn't +[ -e "$HOME"/.welcome/remind ] || return +! [ -e "$HOME"/.hushlogin ] || return + +# Only if rem(1) available +command -v rem >/dev/null 2>&1 || return + +# Print reminders with asterisks +rem -hq | sed 's/^/* /' +printf '\n' |