I just started with python and wrote myself a nice, small script that uses gnome-notifications via pynotify, like this:
import pynotify
pynotify.init("Application")
alert = pynotify.Notification("Title", "Description")
alert.show();
This works great, but the thing is, when I execute the script twice in a row it takes a while for the first notification to go away. The second gets shown after that. Since the first one is obsolete when i execute the script for the second time, I want to remove the first one programmatically prior to showing the second (or replace it). Is this possible, and if it is, how?
A bit of context to understand why I need this: Since I often switch my mouse from left- to right-handed and the other way around, I want a script that just inverts this preference and tells me in a notification "switched to left-handed" and "switched to right-handed".