1

To celebrate April Fools' Day, I'd like to have a super notification mechanism.

Would it be possible to transform my unity launcher into a led chaser? Like this:

enter image description here

1 Answer 1

0

Using the unity Python API, we can set the urgency property of all favorites icons in a loop:

#!/usr/bin/env python3

from gi.repository import Unity, GObject

launchers = Unity.LauncherFavorites.get_default().enumerate_ids()
i = -1
increment = 1

def set_urgency():
    global i
    global increment
    if i == len(launchers) - 1:
        increment = -1
    elif i == 0:
        increment = 1
    i = i + increment
    launcher = Unity.LauncherEntry.get_for_desktop_id(launchers[i])
    urgent = launcher.get_property("urgent")
    launcher.set_property("urgent", not urgent)
    return True

GObject.timeout_add(100, set_urgency)
GObject.MainLoop().run()

You must log in to answer this question.

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