From 232c315b142ce93e85a8175e3828f026691aa57b Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sat, 11 Jul 2009 22:33:33 -0500 Subject: add an option for making watchers cause a bell --- lib/App/Termcast.pm | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/App/Termcast.pm b/lib/App/Termcast.pm index 99c90a3..bdef01b 100644 --- a/lib/App/Termcast.pm +++ b/lib/App/Termcast.pm @@ -3,7 +3,7 @@ use Moose; use IO::Pty::Easy; use IO::Socket::INET; use Term::ReadKey; -with 'MooseX::Getopt'; +with 'MooseX::Getopt::Dashes'; =head1 NAME @@ -47,6 +47,13 @@ has password => ( isa => 'Str', default => 'asdf', # really unimportant documentation => 'Password for the termcast server (mostly unimportant)', + +has bell_on_watcher => ( + is => 'rw', + isa => 'Bool', + default => 0, + documentation => "Send a terminal bell when a watcher connects\n" + . " or disconnects", ); sub run { @@ -95,7 +102,10 @@ sub run { warn "Error reading from socket: $!" unless defined $buf; last; } - # XXX: do something with this? (watcher notification, etc) + if ($self->bell_on_watcher) { + # something better to do here? + syswrite STDOUT, "\a"; + } } } ReadMode 0; -- cgit v1.2.3-54-g00ecf