NAME
litclock – display a clock using quotes from literature


litclock [ –q quotelist ] [ –t hh:mm ]

DESCRIPTION
Litclock will pull a quote from quotefile (defualt $home/lib/litclock.csv) and display it in a large font on a colored background, highlighting the part of the quote matching the current time, followed by the work the quote is from and the work's author. Litclock will update the display as the time progresses.
If a –t argument is given, litclock will use hh:mm instead of the current time when pulling a quote from the list. This is mostly used for testing.
Litclock runs both on Plan 9 and on Unix, using plan9port, Under unix it will use fontsrv(4) to use a nicer system font. It detects unix by looking for the service environment variable either being blank or set to unix.
Quotefile is a csv–formatted file using | characters for separators. The fileds in order are:

hhmm
The time the quote corresponds to, formatted as a 24–hour hh:mm value.

match
The substring of the quote which contains the time; this is matched case–insensitively.

message
The body of the quote.

work
The title of the work the quote is from.

author
The author of the work.

nsfw
Contains the string nsfw if the database considers the quore potentially "not safe for work".

FILES
$home/lib/litclock.csv
https://github.com/JohannesNE/literature–clock/blob/master/litclock_annotated.csv

SOURCE
http://a.9srv.net/src/litclock.c

SEE ALSO
marquee(1), wordwrap(2)
https://github.com/JohannesNE/literature–clock/blob/master/litclock_annotated.csv

BUGS
Owing to its origin from a web app, the original database uses <br>–style line breaks. Modify the original like so:
sed 's/\<br ?.?\>/\\n/g' < original > output
We do not offer any filtering of "nsfw"–tagged entries.
If the database contains multiple lines for a given time, we just pick the first. It would be better to randomize.
If the time moves on to a time without an entry in the database, litclock is supposed to leave the previous message intact, but this is questionable. It crashes if you start on a time without an entry.
There is no fallback mechanism for characters in the input text which aren't in the display font.
It should be possible to set the color, font, and possibly the margin.
Tabs in the input are just rendered as a single space.
The Plan 9 fonts shipped with the system don't offer much variety of style (roman, bold, italic) within the same font and size, so the defaults used here are not as satisfying as those used with fontsrv(4). You may want to import some fonts when running on Plan 9.