Not a dupe
Very much related this one, but slightly different, since the blinking, non-responsive icon is a different problem, not solved by adding:
to the launcher; the icon will still keep blinking for appr. seven seconds. Although the issues in both questions have the same background, both the symptoms and the possible solution are slightly different.
After starting GUI applications from the Unity Launcher (by clicking on the icon), the launcher waits for a window to appear. While waiting, the cursor blinks. It takes the launcher a while before it comes to the conclusion that its "date" (the window) won't show up. While waiting however, the launcher does not accept new clicks to execute the script (again).
The solution in the above linked question, adding
does solve the spinning wheel of the mouse cursor, but does not make the icon responsive again.
Then what does work?
The other solution in the linked answer however (opening a fake, invisible window when starting a non- GUI script from the Unity launcher) will also solve the issue of the blinking icon.
From the linked answer:
- Create, if it does not exist yet, the directory
Copy the script below into an empty file, save it as
fake_window (no extension) in
~/bin and make it executable
from gi.repository import Gtk
from threading import Thread
This is a self-destroying window, to "feed" Unity a fake-window, preventing
the launcher to show a spinning wheel, waiting for a window to appear.
Include the command to run this script at the end of the (your) script.
Thread(target = self.close).start()
t = 0
while t < 150:
pid = subprocess.check_output(["pgrep", "-f", "fake_window"])\
t += 1
window = FakeWin()
# make our window transparent
Add to the very end of your script the command:
Log out and back in (or run
Now the icon will not blink for seven seconds if you run your script from the Unity Launcher.