/usr/share/doc/libffi-platypus-perl/examples/notify.pl is in libffi-platypus-perl 0.45-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | use strict;
use warnings;
use FFI::CheckLib;
use FFI::Platypus;
# NOTE: I ported this from the like named eg/notify.pl that came with FFI::Raw
# and it seems to work most of the time, but also seems to SIGSEGV sometimes.
# I saw the same behavior in the FFI::Raw version, and am not really familiar
# with the libnotify API to say what is the cause. Patches welcome to fix it.
my $ffi = FFI::Platypus->new;
$ffi->lib(find_lib_or_exit lib => 'notify');
$ffi->attach(notify_init => ['string'] => 'void');
$ffi->attach(notify_uninit => [] => 'void');
$ffi->attach([notify_notification_new => 'notify_new'] => ['string', 'string', 'string'] => 'opaque');
$ffi->attach([notify_notification_update => 'notify_update'] => ['opaque', 'string', 'string', 'string'] => 'void');
$ffi->attach([notify_notification_show => 'notify_show'] => ['opaque', 'opaque'] => 'void');
notify_init('FFI::Platypus');
my $n = notify_new('','','');
notify_update($n, 'FFI::Platypus', 'It works!!!', 'media-playback-start');
notify_show($n, undef);
notify_uninit();
|