File: LibNotify.pm

package info (click to toggle)
alice 0.19-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 968 kB
  • sloc: javascript: 9,698; perl: 4,116; makefile: 14; sql: 8
file content (24 lines) | stat: -rw-r--r-- 487 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package App::Alice::Notifier::LibNotify;

use Desktop::Notify;
use Any::Moose;

has 'client' => (
  is      => 'ro',
  isa     => 'Desktop::Notify',
  default => sub {
    return Desktop::Notify->new;
  }
);

sub display {
  my ($self, $message) = @_;
  my $notification = $self->client->create(
    summary => $message->{nick} . " in " . $message->{window}->{title},
    body    => $message->{body},
    timeout => 3000);
  $notification->show;
}

__PACKAGE__->meta->make_immutable;
1;