3

The synopsis of my project is to schedule a notification and force the icon that appears in the Unity launcher to keep jiggling perpetually (until I become aware of it and deactivate it).

Running Ubuntu 14.04, I execute the following:

sleep 60; notify-send -t 0 "TIME UP!"

This results in the following alert box and a concomitant icon in the launcher:

enter image description here

Unfortunately, the alert notification is too easy to miss. (For some reason, it always appears behind my gnome-terminal.)

So is there any way I can get control of the animation for the icon in the launcher?

1 Answer 1

1

You can do it in Python like this:

#!/usr/bin/env python

from gi.repository import Unity, GObject

launcher = Unity.LauncherEntry.get_for_desktop_id ("notify-osd.desktop")

def do_urgency():
    urgent = launcher.get_property("urgent")
    launcher.set_property("urgent", not urgent)
    return True

GObject.timeout_add_seconds(1, do_urgency)

GObject.MainLoop().run()

Unfortunately the documentation for the Unit7 launcher API doesn't seem to be online any more (or ta least I can't find it now).

4
  • You stole my answer :P In all seriousness though, I don't see how this entirely addresses the OP's issue, he wants the notify-send dialog to wiggle.
    – Seth
    Feb 21, 2015 at 0:21
  • Ooops, I missed that, thanks. You need to use notify-osd.desktop as desktop_id. Fixed that in my answer. Feb 21, 2015 at 0:30
  • Nice job, better answer than I could have come up with :)
    – Seth
    Feb 21, 2015 at 0:31
  • Documentation (for Python and C++) at wiki.ubuntu.com/Unity/LauncherAPI Mar 9, 2015 at 14:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .