aboutsummaryrefslogtreecommitdiff
path: root/bash/bash_profile.d/remind.bash
blob: a8f145998743ec930c7dce764cc43f0dbb0fc23b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Only if shell is interactive
if [[ $- != *i* ]] ; then
    return
fi

# Only if rem(1) available
if ! hash rem 2>/dev/null ; then
    return
fi

# Only if reminders file exists
if [[ ! -e ${DOTREMINDERS:-$HOME/.reminders} ]] ; then
    return
fi

# Print from subshell to keep namespace clean
(
    while IFS= read -r reminder ; do
        printf '* %s\n' "$reminder"
    done < <(rem -hq)
    printf '\n'
)