I am attempting to update the progress bar within the Unity launcher for a simple
python/Gtk application created using
test; however, following the instructions in this video, I have not been able to successfully update the progress bar in the
In the Unity Integration video,
Quickly was not used, so the way that the application was structured was slightly different, and the code used in the video does not seem to function properly without modification in a default
Quickly ubuntu-application template application.
Here is a screenshot of the application icon as it is currently displayed in the Unity Launcher.
Here is a screenshot of the kind of Unity launcher progress bar functionality that I would like (overlayed on mail icon: wiki.ubuntu.com).
.zip file containing the project files can be found here.
I would expect the above code to show a progress bar that is 75% full overlayed on the icon for the test application in the Unity Launcher, but the application only runs and displays no progress bar when the command
quickly run is executed.
I believe that the problem is that I am not properly getting a reference to the application's main window, however, I am not sure how to properly fix this problem. I also believe that the line:
self.launcher = Unity.LauncherEntry.get_for_desktop_id("test.destkop") may be another source of complication because
.desktop.in files rather than ordinary
.desktop files, so I am not sure if that might be causing issues as well.
Perhaps, another source of the issue is that I do not entirely understand the difference between
.desktop.in files. Does it possibly make sense to make a copy of the
test.desktop.in file and rename it
test.desktop, and place it in
/usr/share/applications in order for
get_for_desktop_id("test,desktop") to reference the correct
Related Research Links
Although, I am still not clear on the difference between .desktop and .desktop.in files, I have done some research on .desktop files and I have come across a couple of links:
- Desktop Entry Files (library.gnome.org)
- Desktop File Installation Directory (askubuntu.com)
- Unity Launcher API (wiki.ubuntu.com)
- Desktop Files: putting your application in the desktop menus (developer.gnome.org)
- Desktop Menu Specification (standards.freedesktop.org)
python setup.py build and then navigating to
/build/share/applications and moving the built
test.desktop file to
~/.local/share/applications, and finally executing
quickly run, only a question mark for an icon is being displayed, with no visible progress bar.
After further investigation of the built
.desktop file, it turns out that the line:
Icon=/usr/share/test/media/test.svg within the
.desktop file was pointing to an icon file called
test.svg which did not exist.
In order to resolve this problem, I created a new folder called
/usr/share/ using the command
sudo mkdir test and then created another folder inside of the test folder called
media using the command
sudo mkdir media, and then I moved the
test.svg icon file located in my Quickly project directory at
.svg icon for the application now displays properly in the Unity launcher bar and in the alt-tab view, however there is still no visible progress bar as shown in the screenshot below.
As @dobey, pointed out, there was a typo in the code of the TestWindow.py file at the line:
self.launcher = Unity.LauncherEntry.get_for_desktop_id("test.destkop"),
test.destkop, should be
I changed this typo and no visible changes occurred when the application was executed using
quickly run. However, after adding the line
print('Integrating with launcher') to
add_launcher_integration() there was no corresponding output in the terminal when the application was run, indicating that the problem seems to be that
add_launcher_integration() does not seem to be called correctly when the application starts.
After further investigation, it turns out that
add_launcher_integration() is in fact called when the application starts. With the addition of the line:
prior to the line
print("Integrating with launcher")
the message "Integrating with launcher" now displays in the
However, there is still no progress bar visisble in the Unity launcher bar.
After rebuilding the
Quickly project by executing
python setup.py build and moving the built
.desktop file within the
Quickly project located at
~/.local/share/applications, the application icon and the progress bar now displays properly in the Unity launcher bar. A screenshot of the launcher integration can be seen below.