diff options
author | Florian Pritz <bluewind@xinu.at> | 2018-07-17 15:26:40 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2018-07-17 15:26:40 +0200 |
commit | 50a37d8812c95c60203b0102db91f0c080d4d93b (patch) | |
tree | 86d1c9b2e5461e872fdfbcb207a4e07a9f37283e /lib/App/ImapNotify/Notifier.pm | |
parent | 6e43e5e33b7d4fceaadb42e8264a7319002848cb (diff) | |
download | App-ImapNotify-50a37d8812c95c60203b0102db91f0c080d4d93b.tar.gz App-ImapNotify-50a37d8812c95c60203b0102db91f0c080d4d93b.tar.xz |
Initial port of single file script
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'lib/App/ImapNotify/Notifier.pm')
-rw-r--r-- | lib/App/ImapNotify/Notifier.pm | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/lib/App/ImapNotify/Notifier.pm b/lib/App/ImapNotify/Notifier.pm new file mode 100644 index 0000000..66e6fa6 --- /dev/null +++ b/lib/App/ImapNotify/Notifier.pm @@ -0,0 +1,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__ |