~ubuntu-branches/debian/jessie/alice/jessie

« back to all changes in this revision

Viewing changes to lib/App/Alice/Notifier/LibNotify.pm

  • Committer: Bazaar Package Importer
  • Author(s): Dave Walker (Daviey)
  • Date: 2011-07-29 22:17:12 UTC
  • Revision ID: james.westby@ubuntu.com-20110729221712-av9dbulzigsrx3n7
Tags: upstream-0.19
ImportĀ upstreamĀ versionĀ 0.19

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package App::Alice::Notifier::LibNotify;
 
2
 
 
3
use Desktop::Notify;
 
4
use Any::Moose;
 
5
 
 
6
has 'client' => (
 
7
  is      => 'ro',
 
8
  isa     => 'Desktop::Notify',
 
9
  default => sub {
 
10
    return Desktop::Notify->new;
 
11
  }
 
12
);
 
13
 
 
14
sub display {
 
15
  my ($self, $message) = @_;
 
16
  my $notification = $self->client->create(
 
17
    summary => $message->{nick} . " in " . $message->{window}->{title},
 
18
    body    => $message->{body},
 
19
    timeout => 3000);
 
20
  $notification->show;
 
21
}
 
22
 
 
23
__PACKAGE__->meta->make_immutable;
 
24
1;