summaryrefslogtreecommitdiffstats
path: root/notify.pl
diff options
context:
space:
mode:
Diffstat (limited to 'notify.pl')
-rw-r--r--notify.pl13
1 files changed, 10 insertions, 3 deletions
diff --git a/notify.pl b/notify.pl
index 037c099..c87b02f 100644
--- a/notify.pl
+++ b/notify.pl
@@ -24,6 +24,13 @@ $VERSION = "0.2.0";
Irssi::settings_add_str('notify', 'notify_icon', 'gtk-dialog-info');
Irssi::settings_add_str('notify', 'notify_time', '5000');
+sub atoi {
+ my $t;
+ foreach my $d (split(//, shift())) {
+ $t = $t * 10 + $d;
+ }
+}
+
sub notify {
my ($server, $summary, $message) = @_;
my $bus = Net::DBus->session;
@@ -37,15 +44,15 @@ sub notify {
$message =~ s/</&lt;/g;
$message =~ s/>/&gt;/g;
$message =~ s/'/&apos;/g;
-
- $obj->Notify("notification.pl",
+
+ $obj->Notify("notify.pl",
0,
'',
$summary,
$message,
['Close', 'Close'],
{0, 0, 0},
- 5_000);
+ atoi(Irssi::settings_get_str('notify_time')));
}
sub print_text_notify {