My little reminder scripty thing: zenity plus at.
I want to make little ‘notes to self’ so don’t forget stuff, and I want it on the command line and to be really simple. There are plenty of calendar tools for this, but I thought I would put together s tiny little thing for myself.
No dependencies or downloads (well, none for me, since my system already has zenity)… here is my little script, called ‘remind‘:
cat ~/bin/remind echo 'DISPLAY=' > ~/.reminders/temp1remind echo $DISPLAY > ~/.reminders/temp2remind echo ' zenity --warning --text="' > ~/.reminders/temp3remind echo $2 > ~/.reminders/temp4remind echo '"' > ~/.reminders/temp5remind paste -d '' ~/.reminders/temp[1-5]remind > ~/.reminders/"atjob$1" rm ~/.reminders/temp[1-5]remind chmod 700 ~/.reminders/"atjob$1" cat ~/.reminders/"atjob$1" at $1 -f ~/.reminders/"atjob$1"
So what this does is create a little file in the newly-made directory .reminders. The file name looks like atjobTIME where TIME is a time expression complying with the syntax of the at command. The idea is that the file will act as input to at.
The remind script above is stuck in my ~/bin directory and made executable. I call it like this (dollar is command prompt):
$ remind "12:52 tomorrow" "Lousy test"
(note the quotes, needed if the entry has any spaces or other tricky characters) and it creates a little file in .reminders (a directory created for this purpose) and then runs at, calling that job. So the little file looks like this:
$ cat .reminders/"atjob12:52 tomorrow" DISPLAY=:0.0 zenity --warning --text="Lousy test"
And it creates a little zenity dialogue box that looks like this:
“Gee, wow.” Well, no, no wow at all, but it works. I suppose .reminders might fill up with tiny little files, but I can’t say it troubles me. I’ll clean them up some time. And I know all the piping stuff to little files is clumsy, but it works for me.