Skip to content

Instantly share code, notes, and snippets.

@tynovsky
Created September 21, 2017 17:25
Show Gist options
  • Save tynovsky/a6dcda958847e30e4f0646a708cf30a1 to your computer and use it in GitHub Desktop.
Save tynovsky/a6dcda958847e30e4f0646a708cf30a1 to your computer and use it in GitHub Desktop.
perl dbus
#!/usr/bin/perl
use strict;
use warnings;
use Net::DBus;
my $bus = Net::DBus->find;
my $notify_service = $bus->get_service("org.freedesktop.Notifications");
my $notify_object = $notify_service->get_object(
"/org/freedesktop/Notifications",
"org.freedesktop.Notifications"
);
$notify_object->Notify(
"DEMO", 0, "/home/miroslav/avast-logo.png", "hello!", "hello world", [], {}, 3
);
################################################################################
my $busobject = $bus->get_bus_object;
for my $name ( @{$busobject->ListNames} ) {
if ($name !~ /^:/) {
my $service = $bus->get_service($name);
print "SERVICE: $name\n";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment