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:
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()