aboutsummaryrefslogtreecommitdiff
path: root/bash/bash_profile.d/remind.bash
blob: 92f139240c3e1e82ef0b44162de98c5ac3f2de04 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# 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'
)