diff options
author | Paul W. Frields <stickster@gmail.com> | 2007-01-28 01:54:50 +0000 |
---|---|---|
committer | Paul W. Frields <stickster@gmail.com> | 2007-01-28 01:54:50 +0000 |
commit | 08de8ea8f9bf34bb6182b5e473ec7fd442fb3ddc (patch) | |
tree | 2b3b38693549b3461a285e34e88fe89472d3f6d8 | |
parent | efd2efb54863b16bbcd0730e86194cb1001f8562 (diff) | |
download | irssi-notify-08de8ea8f9bf34bb6182b5e473ec7fd442fb3ddc.tar.gz irssi-notify-08de8ea8f9bf34bb6182b5e473ec7fd442fb3ddc.tar.xz irssi-notify-08de8ea8f9bf34bb6182b5e473ec7fd442fb3ddc.zip |
Try a better test for DBus service existence
git-svn-id: https://irssi-libnotify.googlecode.com/svn/trunk@20 291cbfae-0d27-0410-99d7-557b17e6fe3d
-rw-r--r-- | notify.pl | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -16,7 +16,7 @@ $VERSION = "0.01"; authors => 'Luke Macken, Paul W. Frields', contact => 'lewk@csh.rit.edu, stickster@gmail.com', name => 'notify.pl', - description => 'Use libnotify to alert user to hilighted messages', + description => 'Use D-Bus to alert user to hilighted messages', license => 'GNU General Public License', url => 'http://lewk.org/log/code/irssi-notify', ); @@ -27,11 +27,12 @@ Irssi::settings_add_str('notify', 'notify_time', '5000'); sub notify { my ($server, $summary, $message) = @_; my $bus = Net::DBus->session; - return if (!$bus); + + if (!&test_dbus("org.freedesktop.Notifications")) { + return; + } my $svc = $bus->get_service("org.freedesktop.Notifications"); - return if (!$svc); my $obj = $svc->get_object("/org/freedesktop/Notifications"); - return if (!$obj); # Make the message entity-safe. This is all a crappy hack and I'd # love to know a Perl-ish way to do this properly. |