I am writing a perl script which I want to make it send a desktop notification. It polls for changes somewhere and then it will create a text file of changes. Next it will send a notification to the desktop (I'm using KDE, actually). In the notification should be a clickable button that when clicked, the default text editor should appear with the text file in it. Note I am using "kate" hard coded right now because I don't yet know how to detect the default text editor.
What happens with my code is Kate appears with the text in it first, while giving an error (see code comments below) and then after closing Kate the notification and button appears. Clicking the button does nothing.
I'm doing this in perl because I'm best at perl and also because I'm going to use this as a weekly cron job to poll and parse a web site, compare with data I have and then alert me if there was new data and give me a text list of the new data (thus the See List button).
Below is what I have so far. Can someone instruct me on how I can fix this? I've used Google and can't find any examples of proper usage of add_action.
Code:
#!/usr/bin/perl
# Distro: SolydK (Debian Testing (Jesse) based)
# KDE 4.13.3
# Depenencies installed:
# gir1.2-appindicator3-0.1
# gir1.2-notify-0.7
# libnotify
# perl-glib-object-introspection
use Glib::Object::Introspection;
Glib::Object::Introspection->setup (
basename => 'Notify',
version => '0.7',
package => 'Notify');
Notify->init;
my $popupnote = Notify::Notification->new("New Items Detected", "There are new items for your review.", "dialog-information");
# The add_action below pops up Kate with the text file in it first, and gives this error:
# QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave.
# Then after closing Kate the desktop notification will pop up with "See List" button appears.
# The See List button does nothing when clicked.
$popupnote->add_action("actionList", "See List", "default", eval(system("kate ~/Temp/Test.txt")));
$popupnote->show;