I have a script, which I start from the Unity Launcher. When I click on the icon, my script starts successfully.

While the script only takes a split second to run, the launcher icon blinks for about 7-8 sec., during which the launcher is occupied and doesn't respond to additional clicks.

Can I customize my bash script in such a way that the blinking icon doesn't block the script for seven seconds?

I use Ubuntu 15.10.

  • Hi klpu, posted my answer. please let me know if anything is unclear. Mar 11, 2016 at 14:14

1 Answer 1


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.

The cause

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:

  1. Create, if it does not exist yet, the directory ~/bin
  2. Copy the script below into an empty file, save it as fake_window (no extension) in ~/bin and make it executable

    #!/usr/bin/env python3
    from gi.repository import Gtk
    from threading import Thread
    import time
    import subprocess
    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.
    class FakeWin(Gtk.Window):
        def __init__(self):
            Gtk.Window.__init__(self, title="1526closeme")
            Thread(target = self.close).start()
        def close(self):
            t = 0
            while t < 150:
                    pid = subprocess.check_output(["pgrep", "-f", "fake_window"])\
                    subprocess.Popen(["kill", pid])
                except subprocess.CalledProcessError:
                t += 1
    def fakewindow():
        window = FakeWin()
        # make our window transparent
  3. Add to the very end of your script the command:

  4. Log out and back in (or run source ~/.profile)

Now the icon will not blink for seven seconds if you run your script from the Unity Launcher.


You must log in to answer this question.

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