########################################################################
# REMIND
########################################################################


# remind
alias rem="clear; remind -c+cu4 -wt ~/.reminders"
alias remy="clear; remind -cu12 -wt ~/.reminders | less -r"
rems() {
    #echo "Reminders for $(date +%Y/%m/%d) (today)"
    remind ~/.reminders
    echo
    echo "Next 10 Reminders:"
    remind -n .reminders | sort -n  | head -10

}

rem-sync() {(
        set -xe
        scp -q vorstand@vorstand.uugrn.org:private/Kalender/uugrn.rem sdk@home.codevoid.de:.reminders/uugrn.rem
        scp -q sdk@home.codevoid.de:.reminders/\*.rem /home/sdk/.reminders/
)}

rem-uugrn() {(
    set -xe
    vim sftp://vorstand@vorstand.uugrn.org/private/Kalender/uugrn.rem
    ssh -q sdk@vorstand.uugrn.org sh ~sdk/.bin/make_calendar.sh
    rem-sync
)}

rem-personal() {(
    set -xe
    vim sftp://sdk@home.codevoid.de/.reminders/personal.rem
    rem-sync
)}

rem-birthdays() {(
    set -xe
    vim sftp://home.codevoid.de/.reminders/birthdays.rem
    rem-sync
)}

sync-ical2rem() {
    # XXX can haz this in nice?
    find ~/.isync -name "*.ics" -exec cat {} + \
        | ical2rem --no-todos \
        | fgrep -v "REM  MSG" \
        | sed 's,\\n, ,g' \
        | tr -d '\' \
        | sed 's/  / /g'  \
            > .reminders/import.rem
}
