Using `at` command - eviltoast

A lot of people haven’t heard of the at command, and I just figured I’d post up a little bit about it. I use it as a semi-alarm clock type reminder.

Structure of command the way I use it:

echo "notify-send -u critical -t 0 'YOUR URGENT MESSAGE'" | at "2pm Jun 18"

I actually wrote a tiny function so that I don’t have to remember the -u critical -t 0 part. That is to keep the notification box from timing out. Now tomorrow (June 18th) at 2pm, a message box will pop up with the text “YOUR URGENT MESSAGE”.

There are options for running commands (like cron, but you don’t have to edit, then delete your edit after running). It is great if you don’t want to mess with cron, or another utility for a quick reminder.

My quick little function looks like this:

notify_me ()
{
    if [[ $# -ne 2 ]]; then
        echo 'Usage:  notify_me "message" time/date' 1>&2;
        echo '                   make sure to enclose message in quotes' 1>&2;
        echo "                   also enclose date if it's more than just a time" 1>&2;
        return;
    fi;
    echo "notify-send -u critical -t 0 '$1'" | at "$2"
}

So say I have to remind myself to call the wife when the work day is over. I’ll do something like:

notify_me "Check with the ol' ball and chain" "4:45pm"

I’m sure if you wanted to, you could make a very quick zenity (or whatever you like) gui for it, if that’s the way you roll. Now I’ll get a nice little pop-up 15 minutes before I check out. Tiny little things like this are why I enjoy the command line so much.

For more uses, check out the man page, or the tldr. It’s not complicated and I find it useful.