aboutsummaryrefslogtreecommitdiff
path: root/sh/profile.d/remind.sh
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-08-20 00:43:35 +1200
committerTom Ryder <tom@sanctum.geek.nz>2016-08-20 01:21:09 +1200
commit1ce0e2ad424bf38768094488774eff23b3871ccc (patch)
treeb9d407b2fb7729456ce554d4d610a194447ad737 /sh/profile.d/remind.sh
parentUse terser shell for executable installs (diff)
downloaddotfiles-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.sh19
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'