blob: 66e6fa68435e6e8bc0d14f7209e6967d28d135cb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
package App::ImapNotify::Notifier;
use v5.24;
use strict;
use warnings;
use Function::Parameters;
=head1 NAME
App::ImapNotify::Notifier - Show notification to user
=head1 SYNOPSIS
use App::ImapNotify::Notifier;
my $notifier = App::ImapNotify::Notifier->new();
$notifier->notify("subject", "body");
=head1 DESCRIPTION
Uses notify-send to show a notification to the user.
=head1 SEE ALSO
L<App::ImapNotify>
=cut
method new($class: $deps = {}) {
return $class->new_no_defaults($deps);
}
method new_no_defaults($class: $deps = {}) {
my $self = {};
bless $self, $class;
$self->{deps} = $deps;
return $self;
}
method notify($heading, $body) {
system(qw(notify-send -t 10000 --), $heading, $body);
}
1;
__END__
|