.\" $Id: karolarm.1,v 1.25 2011/03/09 09:51:50 kili Exp $ .\" .\" Copyright (c) 2007, 2009, 2010 Matthias Kilian .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above .\" copyright notice and this permission notice appear in all copies. .\" .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .Dd $Mdocdate: March 9 2011 $ .Dt KAROLARM 1 .Os .Sh NAME .Nm karolarm .Nd monitor the state of your games at karopapier.de .Sh SYNOPSIS .Nm karolarm .Op Fl a .Op Fl b Ar brokeninterval .Op Fl i Ar interval .Op Ar user .Sh DESCRIPTION The .Nm utility polls karopapier.de for pending games of .Ar user at the given .Ar interval. If no .Ar user is specified, the local (unix) user id will be used instead. When there is at least one pending game, .Nm writes a notification to all ttys currently owned by the user that are group writable, or, if the .Fl a option is specified, to all ttys owned by the user, even to those that are not group writable. .Pp No additional notifications will be sent unless at least one intermediate poll resulted in no pending games or a SIGHUP has been sent to .Nm or the number of pending games increases right after it decreased (i.e. if the user played some games while at the same time getting more pending games). The latter heuristic tries to circumwent situations where you work through all pending games, then close your browser, and then get another pending games within less than .Ar interval seconds, without .Nm noticing that the number of pending games was 0 for a short time. .Pp If an error occurs during polling, the interval is temporarily changed to .Ar brokeninterval to avoid spamming the user in case karopapier.de suffers from temporar outages. .Pp .Nm will exit if there are no more ttys owned by the user (probably because the user has logged out). .Pp Standard options are as follows: .Bl -tag -width Ds .It Fl a Write notifications to all ttys, even if they are not group writable. .It Fl b Ar brokeninterval Temporarily used interval after polling failed. The default .Ar brokeninterval is 300 seconds. .It Fl i Ar interval Poll at the given interval (in seconds). The default .Ar interval is 15 seconds. .El .Sh EXAMPLES Let .Nm notify you whenever there are pending games for the karopapier user .Dq Crash King (the quotes are needed because the name contains a space character): .Pp .Dl $ karolarm 'Crash King' & .Pp Note that it is usually safe to run .Nm in the background. .Pp If your unix account is the same as the karopapier user you want to watch, you can omit the username. For example, if your unix account is .Dq kili , the following two lines are equivalent: .Pp .Dl $ karolarm & .Dl $ karolarm kili & .Pp If you want to be notified really fast, specify an interval shorter than the default interval of 15 seconds: .Pp .Dl $ karolarm -i 5 & .Pp To let a running .Nm send another notification after the current interval (if there still are pending games), just send it a SIGHUP signal: .Pp .Dl $ karolarm & .Dl $ karopid=$! .Dl ... .Dl $ kill -HUP $karopid .Pp .Sh SEE ALSO .Xr mesg 1 .Pp .Sh AUTHORS .An Matthias Kilian Aq kili@openbsd.org .Pp .Sh BUGS The heuristic for detecting short periods of 0 pending games may trigger spurious notifications when new pending games come in faster than you can work through your game list.