Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Trying to let my python application inform the user by wiggling or shaking its icon in the launcher, I found:

Wiggling seems to be the "urgent animation": How can I change the wiggle time of 'urgent animation' in Unity Launcher?

https://wiki.ubuntu.com/Unity/LauncherAPI describes an API with a function to set an urgent flag on a LaucherEntry. But the vala example doesn't use it and the python example doesn't show any visual effect on my Ubuntu 11.10 for setting (or clearing) the "urgent" property (progress and count are working). The example python code does not use the API-C function unity_launcher_entry_set_urgent, but writes to the property directly, which maybe is the problem (and means not using the API in an API documentation example ...)

So, I am looking for a working python "wiggle" example. Or a working C example. Or some hints, why this is not working.

share|improve this question

1 Answer 1

Check out the Python example in the Unity developer documentation, and try hello-unity (only compatible with Ubuntu 12.04). These are good places to start.

Here's some bit of Python code that will make your app's icon wiggle in the launcher. It's for Ubuntu 12.04, but looking at the API documentation, it should also work for 11.10.

from gi.repository import Unity

self.launcher = Unity.LauncherEntry.get_for_desktop_id("myapp.desktop")
self.launcher.set_property("urgent", True)
share|improve this answer
    
Hi David, developer.ubuntu.com/resources/technologies/launcher is just a copy of wiki.ubuntu.com/Unity/LauncherAPI with the same issues. And hello-unity is a longer example which doesn't install on Ubuntu 11.10 due to missing bindings and also simply uses set_property("urgent", ...), which didn't work for me. Did this example wiggle for you? –  Christian A. Schmidt May 20 '12 at 22:13
    
Hi Christian, as mentioned in the documentation setting the urgent property is the right way to make the launcher icon wiggle. There is no dedicated function to do it in the Python bindings. I'd recommend trying the code above and seeing if it works for you. Regarding hello-unity, it's compatible with Ubuntu 12.04 onwards, as it was designed around the new Unity API. –  David Planella May 21 '12 at 6:05

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.