.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 .\" .\" Standard preamble: .\" ======================================================================== .de Sh \" Subsection heading .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .\" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .hy 0 .if n .na .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "WHEN 1" .TH WHEN 1 "2007-09-02" "1.1.7" "When 1.1.7" .SH "NAME" When \- a minimalistic personal calendar program .SH "SYNOPSIS" .IX Header "SYNOPSIS" when .PP when [options] [commands] .SH "COMMANDS" .IX Header "COMMANDS" .IP "\fBi\fR" 8 .IX Item "i" Print upcoming items on your calendar. (This is the default command.) .IP "\fBc\fR" 8 .IX Item "c" Print calendars for last month, this month, and next month. .IP "\fBe\fR" 8 .IX Item "e" Invoke your favorite editor to edit your calendar file. .IP "\fBw\fR,\fBm\fR,\fBy\fR" 8 .IX Item "w,m,y" Print items for the coming week, month, or year, rather than for the default period of two weeks. .IP "\fBj\fR" 8 .IX Item "j" Print the modified Julian day (useful for finding the time interval between two dates). .IP "\fBd\fR" 8 .IX Item "d" Print nothing but the current date. .SH "OPTIONS" .IX Header "OPTIONS" All of the following options, except \-\-help, can be set in the preferences file. True/false options can be set on the command line as \-\-option or \&\-\-nooption, and in the preferences file by setting option to 0 or 1. .IP "\-\-help" 8 .IX Item "--help" Prints a brief help message. .IP "\-\-version" 8 .IX Item "--version" Prints a brief message, including a statement of what version of the software it is. .IP "\-\-language=LANG" 8 .IX Item "--language=LANG" Set the language to \s-1LANG\s0. See the section below on internationalization. This option is not normally needed, because the language is automatically detected. .IP "\-\-past=DAYS" 8 .IX Item "--past=DAYS" How many days into the past the report extends. Default: \-1 .IP "\-\-future=DAYS" 8 .IX Item "--future=DAYS" How many days into the past the report extends. Default: 14 .IP "\-\-calendar=FILE" 8 .IX Item "--calendar=FILE" Your calendar file. The default is to use the file pointed to by your preferences file, which is set up the first time you run When. .IP "\-\-editor=COMMAND" 8 .IX Item "--editor=COMMAND" Command used to invoke your editor. Default: emacs \-nw Example: when \-\-editor=\*(L"vi \-R\*(R" .IP "\-\-wrap=COLUMNS" 8 .IX Item "--wrap=COLUMNS" Number of columns of text for the output (or 0 if you don't want wrapping at all). Default: 80 .IP "\-\-[no]wrap_auto" 8 .IX Item "--[no]wrap_auto" Attempt to detect the width of the terminal, and set the width of the output accordingly. This applies only if the output is a tty, and is subject to any maximum set by \-\-wrap_max. Overrides any value set by \-\-wrap. Default: no .IP "\-\-wrap_max=COLUMNS" 8 .IX Item "--wrap_max=COLUMNS" Maximum number of columns of text for the output (or \-1 if you don't want any maximum). Useful in combination with \-\-wrap_auto to preserve legibility on very large terminal windows. Default: \-1 .IP "\-\-rows=COLUMNS" 8 .IX Item "--rows=COLUMNS" Number of rows of text that will fit in the terminal window. When listing your calendar, output will be truncated to this length, unless that would result in listing less than three days into the future. This behavior is overridden (the maximum number of rows is set to infinity) if the \-\-future option is given explicitly on the command line, or if the m or y command is used. Default: 40 .IP "\-\-[no]rows_auto" 8 .IX Item "--[no]rows_auto" Attempt to detect the height of the terminal, rather than using the value set in the \-\-rows option. This applies only if the output is a tty. Overrides any value set by \-\-rows. Default: yes .IP "\-\-[no]paging" 8 .IX Item "--[no]paging" When the output is longer than the value set by rows or rows_auto, use a pager to display the output. (The \s-1PAGER\s0 and \s-1LESS\s0 environment variables are respected. If \s-1PAGER\s0 isn't set, the default is \*(L"less.\*(R") Default: yes .IP "\-\-paging_less_options" 8 .IX Item "--paging_less_options" Extra options if the pager is \*(L"less.\*(R" Default: \*(L"\-rXFE\*(R" .IP "\-\-[no]filter_accents_on_output" 8 .IX Item "--[no]filter_accents_on_output" Whether to change accented characters to unaccented ones. Default: yes, unless the \f(CW$TERM\fR environment variable equals \*(L"mlterm\*(R" or \*(L"xterm\*(R". .IP "\-\-[no]styled_output" 8 .IX Item "--[no]styled_output" If the output is a terminal, should we use \s-1ANSI\s0 terminal codes for styling? Default: yes .IP "\-\-[no]styled_output_if_not_tty" 8 .IX Item "--[no]styled_output_if_not_tty" Style the output even if it's not a terminal. Default: no .IP "\-\-calendar_today_style=STYLE" 8 .IX Item "--calendar_today_style=STYLE" How to style today's date when doing the calendar (c) command. Default: bold .IP "\-\-items_today_style=STYLE" 8 .IX Item "--items_today_style=STYLE" How to style the word ``today'' when doing the items (i) command. Default: bold .ie n .IP "\-\-now=""Y M D""" 8 .el .IP "\-\-now=``Y M D''" 8 .IX Item "--now=Y M D" Pretend today is some other date. .IP "\-\-[no]monday_first" 8 .IX Item "--[no]monday_first" Start the week from Monday, rather than Sunday. Default: no .IP "\-\-[no]ampm" 8 .IX Item "--[no]ampm" Display the time of day using 12\-hour time, rather than 24\-hour time. Default: yes .IP "\-\-test_expression" 8 .IX Item "--test_expression" Used internally by `make test'. .IP "\-\-bare_version" 8 .IX Item "--bare_version" Used internally by the Makefile. .IP "\-\-make_filter_regex" 8 .IX Item "--make_filter_regex" Used internally. .IP "\-\-test_accent_filtering" 8 .IX Item "--test_accent_filtering" Used internally. .PP The styling of output can be specified using the following keywords: bold, underlined, flashing. To change the color of the text, use these: fgblack, fgred, fggreen, fgyellow, fgblue, fgpurple, fgcyan, fgwhite. To change the background color, use similar keywords, but with bg instead of fg. Example: when \-\-calendar_today_style=\*(L"bold,fgred,bgcyan\*(R" c .SH "DESCRIPTION" .IX Header "DESCRIPTION" \&\fBWhen\fR is an extremely simple personal calendar program, aimed at the Unix geek who wants something minimalistic. It can keep track of things you need to do on particular dates. There are a lot of calendar and ``personal information manager'' programs out there, so what reasons are there to use When? .IP "It's a very short and simple program, so you can easily tinker with it yourself." 4 .IX Item "It's a very short and simple program, so you can easily tinker with it yourself." .PD 0 .IP "It doesn't depend on any libraries, so it's easy to install. You should be able to install it on any system where Perl is available, even if you don't have privileges for installing libraries." 4 .IX Item "It doesn't depend on any libraries, so it's easy to install. You should be able to install it on any system where Perl is available, even if you don't have privileges for installing libraries." .IP "Its file format is a simple text file, which you can edit in your favorite editor." 4 .IX Item "Its file format is a simple text file, which you can edit in your favorite editor." .PD .PP Although When should run on virtually any operating system where Perl is available, in this document I'll assume you're running some flavor of Unix. .SH "INSTALLATION AND GETTING STARTED" .IX Header "INSTALLATION AND GETTING STARTED" While logged in as root, execute the following command: .PP .Vb 1 \& make install .Ve .PP Run When for the first time using this command: .PP .Vb 1 \& when .Ve .PP You'll be prompted for some information needed to set up your calendar file. .SH "USE" .IX Header "USE" If you run When again after the initial setup run, it should print out a single line of text, telling you the current date. It won't print out anything else, because your calendar file is empty, so you don't have any appointments coming up. .PP Now you can start putting items in your calendar file. Each item is a line of text that looks like this: .PP .Vb 1 \& 2003 feb 3 , Fly to Stockholm to accept Nobel Prize. .Ve .PP A convenient way to edit your calendar file is with this command: .PP .Vb 1 \& when e .Ve .PP This pops you into your favorite editor (the one you chose when you ran When for the first time). .PP The date has to be in year-month-day format, but you can either spell the month or give it as a number. (Month names are case\-insensitive, and it doesn't matter if you represent February as F, Fe, Feb, Februa, or whatever. It just has to be a unique match. You can give a trailing ., which will be ignored. In Czech, \*(L"cer\*(R" can be used as an abbreviation for Cerven, and \*(L"cec\*(R" for Cervenec.) Extra whitespace is ignored until you get into the actual text after the comma. Blank lines and lines beginning with a # sign are ignored. .PP For events that occur once a year, such as birthdays and annivesaries, you can either use a * in place of the year, .PP .Vb 1 \& * dec 25 , Christmas .Ve .PP or use a year with an asterisk: .PP .Vb 1 \& 1920* aug 29 , Charlie Parker turns \ea, born in \ey .Ve .PP In the second example, \ea tells you how old Charlie Parker would be this year, and \ey reproduces the year he was born, i.e., the output would be: .PP .Vb 1 \& today 2003 Aug 29 Charlie Parker turns 83, born in 1920 .Ve .PP For things you have to do every week, you can use an expression of the form w=xxx, where xxx is the first few letters of the name of the day of the week in your language. (You have to supply enough letters to eliminate ambiguity, e.g., in English, w=th or w=tu, not just w=t.) Example: .PP .Vb 1 \& w=sun , go to church, 10:00 .Ve .PP You can actually do fancier tests than this as well; for more information, see the section 'fancy tests' below. .PP If you now run When, it will print out a list of all the items in your calendar file that fall in the time interval from yesterday through the next two weeks. To see all your items for the next month, do ``when m'', and similarly for a year, y, or a single week, w. .PP If you do ``when c'', When prints out calendars for last month, this month, and next month. .PP You can combine these commands. For instance, ``when cw'' will print out calendars, and then show you your items for the next week. .SH "INTERNATIONALIZATION" .IX Header "INTERNATIONALIZATION" When has at least partial support for English, Polish, Italian, German, Dutch, French, Czech, Danish and Spanish. If When has not been translated into your language, or has only been partially translated, the text that hasn't been translated will be displayed in English. When should automatically detect what language you use (via your \f(CW$LANG\fR environment variable), and if When has been translated into that language, that's what you'll get \*(-- When's output will be in your language, and When will also expect you to use that language in your calendar file for the names of the months and the days of the week. .PP Some terminal emulators (aterm, ...) display accented characters as garbage, but others (mlterm, xterm...) can display them correctly. When checks the \f(CW$TERM\fR environment variable, and if it equals \&\*(L"mlterm\*(R" or \*(L"xterm\*(R", then accented characters will be displayed. Otherwise, they are filtered out of the output. You can override this by putting a line like .PP .Vb 1 \& filter_accents_on_output = 0 .Ve .PP or .PP .Vb 1 \& filter_accents_on_output = 1 .Ve .PP in your ~/.when/preferences file. I'd be interested in hearing from any users who can suggest a better mechanism for this than attempting to interpret the \f(CW$TERM\fR variable. .PP On input, accents are allowed, but not required, e.g., in a French-language input file, the date 2005 Fev 17 could be given with an accented e or an unaccented one, and either will work. The input file and command-line options can be encoded in \s-1UTF\-8\s0, or plain \s-1ASCII\s0 (which is a subset of \s-1UTF\-8\s0). If an input month or day of the week does not match any of the ones for your language, then When will try to interpret it as English instead. .PP You can put a line like .PP .Vb 1 \& language = fr .Ve .PP in your preferences file to set your language, or supply the \-\-language option on the command line, but that's not necessary if your \f(CW$LANG\fR environment variable is set correctly. .SH "FORMAT OF THE PREFERENCES FILE" .IX Header "FORMAT OF THE PREFERENCES FILE" Each line consists of something like this: .PP .Vb 1 \& variable = value .Ve .PP Whitespace is ignored everywhere except inside the value. Variable names are case\-insensitive. Blank lines are ignored. .SH "MORE EXAMPLES" .IX Header "MORE EXAMPLES" A useful command to have your shell execute when you log in is this: .PP .Vb 1 \& when \-\-past=0 \-\-future=1 .Ve .PP To print out a calendar for a full year to come: .PP .Vb 1 \& when \-\-past=0 \-\-future=365 c .Ve .SH "POPPING UP YOUR CALENDAR WHEN YOU LOG IN" .IX Header "POPPING UP YOUR CALENDAR WHEN YOU LOG IN" Your calendar doesn't do you any good if you forget to look at it every day. An easy way to make it pop up when you log in is to make your .xsession or .xinitrc file look like this: .PP .Vb 3 \& /usr/bin/when \-\-past=0 \-\-future=1 &>~/when.today \& emacs \-geometry 70x25 \-bg bisque ~/when.today & \& startkde .Ve .PP The .xsession file is used if you have a graphical login manager set up on your machine, the .xinitrc if you don't. In this example, the first line outputs your calendar to a file. The complete path to the When program is given, because your shell's path variable will not yet be properly initialized when this runs. The second line pops up a \s-1GUI\s0 emacs window, which is distinctively colored so that it will catch your eye. The last line starts your window manager, \s-1KDE\s0 in this example. Whatever window manager you use, just make sure to retain the preexisting line in the file that starts it, and make sure that that line is the very last one in the file. .SH "FANCY TESTS" .IX Header "FANCY TESTS" In addition to w, discussed above, there are a bunch of other variables you can test: .PP .Vb 8 \& w \- day of the week \& m \- month \& d \- day of the month \& y \- year \& j \- modified Julian day number \& a \- 1 for the first 7 days of the month, 2 for the next 7, etc. \& b \- 1 for the last 7 days of the month, 2 for the previous 7, etc. \& e \- days until this year's (Western) Easter .Ve .PP You can specify months either as numbers, m=2, or as names in your language, m=feb. You can also use the logical operators & (and) and | (or). The following example reminds you to pay your employees on the first and fifteenth day of every month: .PP .Vb 1 \& d=1 | d=15 , Pay employees. .Ve .PP This example reminds you to rehearse with your band on the last Saturday of every month: .PP .Vb 1 \& w=sat & b=1 , Rehearse with band. .Ve .PP The following two lines .PP .Vb 2 \& * dec 25 , Christmas \& m=dec & d=25 , Christmas .Ve .PP both do exactly the same thing, but the first version is easier to understand and makes the program run faster. (When you do a test, When has to run through every day in the range of dates you asked for, and evaluate the test for each of those days. On my machine, if I print out a calendar for a whole year, using a file with 10 simple tests in it, it takes a few seconds.) Parentheses can be used, too. .PP Depending on your nationality and religion, you probably have a bunch of holidays that don't lie on fixed dates. In Christianity, many of these (the \*(L"movable feasts\*(R") are calculated relative to Easter Sunday, which is why the e variable is useful. Here are some examples of how to set up some common holidays: e=47 , Mardi Gras e=46 , Ash Wednesday e=7 , Palm Sunday e=0 , Easter Sunday e=0\-49 , Pentecost (49 days after easter) m=jan & w=mon & a=3 , Martin Luther King Day m=sep & w=mon & a=1 , Labor Day m=may & w=mon & b=1 , Memorial Day m=may & w=sun & a=2 , Mother's Day m=jun & w=sun & a=3 , Father's Day m=nov & w=thu & a=4 , Thanksgiving (U.S.) m=oct & w=mon & a=2 , Thanksgiving (Canada) .PP There is a not operator, !: .PP .Vb 1 \& w=fri & !(m=dec & d=25) , poker game .Ve .PP There is a modulo operator, %, and a subtraction operator, \-. Using these, along with the j variable, it is just barely possible for When's little parser to perform the following feat: .PP .Vb 1 \& !(j%14\-1) , do something every other Wednesday .Ve .PP The logic behind this silly little piece of wizardry goes like this. First, we determine, using the command `when j \-\-now=\*(L"2005 jan 26\*(R"', that the first Wednesday on which we want to do this has a Julian day that equals 1, modulo 14. Then we write this expression so that if it's a Wednesday whose Julian day equals 1, modulo 14, the quantity in parentheses will be zero, and taking its logical negation will yield a true value. .PP The operators' associativity and order of priority (from highest to lowest) is like this: .PP .Vb 7 \& left % \& left \- \& left < > <= >= \& left = != \& right ! \& left & \& left | .Ve .SH "ENVIRONMENT" .IX Header "ENVIRONMENT" \&\fB$LANG\fR to automatically detect the user's language .PP \&\fB$TERM\fR to try to figure out if the terminal emulator can display accented characters .SH "FILES" .IX Header "FILES" \&\fB$HOME\fR/.when/calendar \- The default location for the user's calendar (pointed to by the preferences file) .PP \&\fB$HOME\fR/.when/preferences \- The user's preferences. .SH "OTHER INFORMATION" .IX Header "OTHER INFORMATION" When's web page is at .PP .Vb 1 \& http://www.lightandmatter.com/when/when.html , .Ve .PP where you can always find the latest version of the software. There is a page for When on Freshmeat, at .PP .Vb 1 \& http://freshmeat.net/projects/when/ , .Ve .PP where you can give comments, rate it, and subscribe to e\-mail announcements of new releases. .SH "AUTHOR" .IX Header "AUTHOR" When was written by Ben Crowell, http://www.lightandmatter.com/personal/. Dimiter Trendafilov wrote the new and improved parser for date expressions. This man page was based on Bryce Harrington's man page for inkscape. .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" \&\fBCopyright (C)\fR 2003\-2005 by Benjamin Crowell. .PP \&\fBWhen\fR is free software; you can redistribute it and/or modify it under the terms of the \s-1GPL\s0, or, optionally, Perl's license.