In many Debian-flavored distributions, installation is as easy as sudo apt-get install when. You can also find the When source code, Debian, and Gentoo packages on the project's homepage. When is written in Perl and does not require compilation, so installation from source code is easy for anyone who can find their way to the command line. Simply untar the download and enter the resulting directory:
tar xzf when.tar.gz
cd when_dist
Then, as root, enter make install. That's all there is to it. If you get lost, you can get a refresher on the installation process by entering when --help from the when_dist subdirectory. Speaking of help, the man page resulting from the install is your main source of documentation. Unless you read Perl, that is, in which case you can simply view the source code.
Usage
The first time you run when, run it with the e parameter:
when e
That will create a ~/.when subdirectory that contains two key files files -- calendar and preferences -- and also let you choose an editor to use in the future, if you don't care for the default editor, whose name shall be left unspoken so as not to rile the great hordes using it or its rival products, an event certain to bring forth yet another meaningless yet compelling tsunami of flamage which will convince neither side that they hold the wrong position yet bore everyone else to a near-death experience.
Now you're ready to start entering events in your calendar. To enter a LUG meeting for 7 p.m. on March 30, type when e, which will now start the editor you picked earlier, enter 2006 Mar 30,7PM LUG Meeting, and save the file.
Later, when you've forgotten what's on your schedule, just enter when at the command line. When will display the current date and time, plus any events on your calendar for the next 14 days:
Thu 2006 Mar 30 11:14Thu 2006 Mar 30 7PM LUG Meeting
But what if your LUG meets every week? You certainly don't want to have to enter the same line 52 times a year. Start When with the editor option again, remove the first entry, and replace it with one that looks like this:
w=Thu,7PM LUG Meeting
Now when you check your calendar, you'll always see it listed, like this:
Thu 2006 Mar 30 11:23Thu 2006 Mar 30 7PM LUG Meeting Thu 2006 Apr 6 7PM LUG Meeting
Only two weeks' worth are shown, because the default "window" for calendar events is 14 days. Remember the preferences file that was created during installation? You can change the default window and other things there. Let's start by taking a look at what is in our preferences file right now:
calendar = /home/warthawg/.when/calendar editor = vi
The default window for items to appear in our calendar is one day into the past and 14 days into the future. We can change that window simply by adding some lines to the preferences file:
past=-7 future=21
Now when we invoke when, the calendar shows this:
Mon 2006 Mar 27 11:50Thu 2006 Mar 23 7PM LUG Meeting Fri 2006 Mar 24 Basketball game at 3PM Sat 2006 Mar 25 Feed the donkeys at 2PM Thu 2006 Mar 30 7PM LUG Meeting Thu 2006 Apr 6 7PM LUG Meeting Thu 2006 Apr 13 7PM LUG Meeting
Be sure to enter the minus sign in front of the number of days in the past, or your results will not be as expected.
Instead of changing the default behavior when you want to see more or less of the calendar, you can also use command line options to indicate that you want to see a calendar for specific periods. The w, m, and y options allow you to request a report on all activity for the coming week, month, or year instead of simply for the default window.
Just need to see when a specific date falls on the calendar? Use the c to get the previous, current, and next month's calendar:
$ when c
------February------- --------March-------- --------April--------
S M T W T F S S M T W T F S S M T W T F S
1 2 3 4 1 2 3 4 1
5 6 7 8 9 10 11 5 6 7 8 9 10 11 2 3 4 5 6 7 8
12 13 14 15 16 17 18 12 13 14 15 16 17 18 9 10 11 12 13 14 15
19 20 21 22 23 24 25 19 20 21 22 23 24 25 16 17 18 19 20 21 22
26 27 28 26 27 28 29 30 31 23 24 25 26 27 28 29
30
When has a few more tricks up its sleeve, both as command line arguments and options. I refer you to --help and man entries to further your command of When.
Note: Comments are owned by the poster. We are not responsible for their content.
For ages, the standard command-line tools for doing this sort of thing were <tt>cal</tt> and <tt>calendar</tt>. The <tt>cal</tt> program prints calendars. If you want the three-month view, you can simply use <tt>cal -3</tt>, or you can as for a whole year with <tt>cal -y</tt>.
For tracking calendar/diary items, the <tt>calendar</tt> program (in Debian's "<tt>bsdmain</tt>" package, IIRC) offers a similarly formatted file stored in your <tt>~/.calendar/calendar</tt> file. It has the ability to enter repeating items, use relative dates ("three days after 8/28/2006"), be used to mail your calendar via a <tt>cron</tt> job, and comes with a large selection of pre-existing calendars you can merge with your own...various holidays, birthdays, world events, etc.
So my question is "What does <tt>when</tt> offer that <tt>cal</tt> and <tt>calendar</tt> don't?"
-gumnos
One of the most wonderful things about Linux/Unix is that there is no single canonical solution: there is always more than one way to do something.
When I wrote about cal and calender (see this old <a href="http://docs.linux.com/article.pl?sid=04/03/19/0252221" title="linux.com">column</a linux.com>, I didn't assert that they were better than When, and I don't say now that When is better than they are.
I just celebrate the abundance of solutions.
apt-get install did not work - any ideas why?
Posted by: Anonymous Coward on April 04, 2006 02:22 AMroot@1[knoppix]# apt-get install when
Reading package lists... Done
Building dependency tree... Done
E: Couldn't find package when
root@1[knoppix]# apt-get install When
Reading package lists... Done
Building dependency tree... Done
E: Couldn't find package When
root@1[knoppix]#
why is this happening? The Kanotix sourcelist includes all the Debian packages:
# Unstable
deb <a href="http://ftp.de.debian.org/debian" title="debian.org">http://ftp.de.debian.org/debian</a debian.org> unstable main contrib non-free
deb-src <a href="http://ftp.de.debian.org/debian" title="debian.org">http://ftp.de.debian.org/debian</a debian.org> unstable main contrib non-free
# Testing
deb <a href="http://ftp.de.debian.org/debian" title="debian.org">http://ftp.de.debian.org/debian</a debian.org> testing main contrib non-free
deb-src <a href="http://ftp.de.debian.org/debian" title="debian.org">http://ftp.de.debian.org/debian</a debian.org> testing main contrib non-free
# Experimental
#deb <a href="http://ftp.de.debian.org/debian" title="debian.org">http://ftp.de.debian.org/debian</a debian.org><nobr> <wbr></nobr>../project/experimental main contrib non-free
#deb-src <a href="http://ftp.de.debian.org/debian" title="debian.org">http://ftp.de.debian.org/debian</a debian.org><nobr> <wbr></nobr>../project/experimental main contrib non-free
# Kanotix
deb <a href="http://kanotix.com/files/debian" title="kanotix.com">http://kanotix.com/files/debian</a kanotix.com> sid main contrib non-free
deb-src <a href="http://kanotix.com/files/debian" title="kanotix.com">http://kanotix.com/files/debian</a kanotix.com> sid main contrib non-free
Any ideas how I should get the where.deb package?
#