I am trying to develop a desktop notification system with python and Libnotify.
I found this tutorial and tried the example with an action callback, below is my code modification
#initialization of libnotify
Notify.init("Py-Notification")
#creating object
summary = "Wake Up!"
body = "Meeting at 9pm"
notification = Notify.Notification.new(
    summary, body
)    
# Define a callback function
def my_callback_func():
    webbrowser.open('http://google.com')
#adding actions
notification.add_action(
    "action_click",
    "Reply to Alarm",
    my_callback_func,
    None # Arguments
)   
notification.show()
The callback function is not called whenever I click on the "Reply to Alarm" button
Any help.
You need to integrate with D BUS to receive events from your notifications.
Here is good explanation use Glib for it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With