App::BCVI::NotifyClient - Send a notification message back to the user's desktop
Send a message to the desktop notifications widget on your workstation:
$ long-running-command; bnotify "long-running-command has finished"
or fork a background monitor to advise you when a subsequent command pauses for input:
$ bnotify -i Starting background process to monitor /dev/pts/0 for 5 second idle period $ sudo apt-get dist-upgrade ...
This module is a plugin for
bcvi (see: App::BCVI). It uses the
notify command to send a message back for display on the user's desktop. This plugin assumes a plugin back on the workstation will route the message to the desktop notification applet or use some other mechanism to bring it to the attention of the user. The App::BCVI::NotifyDesktop plugin is one implementation of the workstation-end of the protocol.
The plugin registers the
bnotify alias as:
alias bnotify="bcvi --no-path-xlate -c notify"
This alias might be used to signal the user that a long-running process has completed on a remote server, for example:
pg_dump intranet >intranet.dump ; bnotify "Database dump is finished!"
Instead of simply sending a message, you can provide options to fork a background process which will send you a message later when something interesting happens (or doesn't):
- --idle [<seconds>] (alias -i)
If the specified number of seconds (default 20) elapse with no output being written to the TTY, you will receive a notification that the TTY is idle. For example you might use this option to fork a listener and then kick off a dist-upgrade command. If the command pauses awaiting input then you will be notified.
- --output [<seconds>] (alias -o)
--outputoption is essentially the opposite of the
--idle- it will tell you when there has been output on the TTY. By default it will check every 5 seconds. You can specify a different poll interval but this may mean your notifications take longer to arrive.
When you specify
--output, the listener process will actually wait for 20 seconds of idle time before it starts looking for output. This allows you to kick off the command you wish to monitor without getting alerts as you type.
- --tty <path> (alias -t)
--outputoptions will monitor the current TTY by default. This option allows you to monitor a different TTY or even a plain file.
- --once (alias -1)
--outputoption will loop and notify you of each idle time or output event. Use the
<--once> option if you only want to be told about the first event. The background process will exit immediately after sending the notification.
- --kill (alias -k)
Find and kill the background listener associated with the current TTY.
You can look for information at:
https://github.com/grantm/bcvi (under 'plugins')
RT: CPAN's request tracker
AnnoCPAN: Annotated CPAN documentation
Copyright 2010 Grant McLean <email@example.com>
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.