Plasma icons-only task manager: Multiple app versions

Updated: January 22, 2018

Here's a rather unusual problem, if you will. On my most splendid Kubuntu 17.04 Zesty, I use the icons-only task manager. Now, as it happens, while merrily testing the Firefox 57 nightly build and comparing how it worked against the current version (which would be Firefox 55 when I compiled this), I noticed that the system uses the same icon both for the stable build and the nightly build. Well, after all, Firefox is Firefox, right. But I wanted to pin two different launchers to the task manager, one for each different version.

Playing around with what KDE can do, I couldn't find anything simple and straightforward that would let me achieve this. Then I remembered my rather nifty, unique setup with custom WINE applications launchers, which I had successfully added to the list against all odds, and I thought, I sure can figure this one out. Let me show you how you can have multiple icons for multiple versions of the same programs added and pinned to the task manager. To work.

Teaser

Problem, more details

Anyway, Firefox 55 launches without any issues, all good. Firefox 57, same thing. This one is actually installed under /home/roger/firefox-57, but once it starts, it shows as a regular Firefox application in the Plasma task manager. You don't have an option to pin it separately. But I want them both, side by side.

Nightly build grouped as standard app

Edit plasma configuration

In a manner very similar to what we did with a hidden IrfanView (WINE) launcher, we will now create one for Firefox 57. This means both editing the Plasma config file in your home directory, but also creating a Firefox 57 "desktop" file, which contains all the information Plasma needs to properly display the icon and launcher the program. The configuration is stored under:

./.config/plasma-org.kde.plasma.desktop-appletsrc

Back this file up, then open it in a text editor. Look for the launchers section. There will be two sections, corresponding to different types of task managers, but that should not worry you. If you're not sure which one to edit, you can do with both. It's just a harmless addition of a new application launcher.

[Containments][2][Applets][55][Configuration][General]
launchers=file:///usr/share/applications/org.gnome.Screenshot.
desktop,file:///usr/share/applications/org.kde.dolphin.desktop,
file:///usr/share/applications/firefox.desktop,file:///usr/share/
applications/firefox-57.desktop,file:///usr/share/applications/
google-chrome.desktop,file:///usr/share/applications/steam.desktop,
file:///usr/share/applications/skype.desktop,file:///usr/share/
applications/gimp.desktop,file:///home/roger/Desktop//.IrfanView.
desktop,file:///usr/share/applications/vlc.desktop,file:///usr/
share/applications/clementine.desktop,file:///usr/share/
applications/libreoffice-startcenter.desktop,file:///usr/share/
applications/calibre-gui.desktop,file:///usr/share/applications/
org.kde.kate.desktop,file:///usr/local/share/applications/
vmware-player.desktop,file:///usr/share/applications/virtualbox.
desktop,file:///usr/share/applications/org.kde.ksysguard.desktop,
file:///usr/share/applications/systemsettings.desktop,file:///usr/
share/applications/org.kde.konsole.desktop

Notice the list above. I've added a new launcher named firefox-57.desktop between firefox.desktop and google-chrome.desktop. This file does not exist yet and we will need to create it. Save the file, then navigate to /usr/share/applications in the terminal window. Copy the firefox.desktop file to firefox-57.desktop.

This file is just a text configuration that defines the application launcher. It has multiple sections, including name, description, other various fields, in multiple locales, and then toward the end, the part that describes the application behavior on launch. For instance, using Firefox, but this can be any which launcher really:

...
Exec=firefox %u
Terminal=false
X-MultipleArgs=false
Type=Application
Icon=firefox
Categories=GNOME;GTK;Network;WebBrowser;
MimeType=text/html;text/xml;application/xhtml+xml;application/xml;
application/rss+xml;application/rdf+xml;image/gif;image/jpeg;
image/png;x-scheme-handler/http;x-scheme-handler/https;x-scheme-
handler/ftp;x-scheme-handler/chrome;video/webm;application/x-
xpinstall;
StartupNotify=true
Actions=NewWindow;NewPrivateWindow;
...

We need to change Exec to /home/roger/firefox-57/firefox. We need to change the icon to /home/roger/firefox-57/browser/icons/mozicon128.png. And that's about it really. Again, the specific changes will depend on your application, but the concept is identical for any use case.

...
Exec=/home/roger/firefox-57/firefox %u
Terminal=false
X-MultipleArgs=false
Type=Application
Icon=/home/roger/firefox-57/browser/icons/mozicon128.png
...

Save the changes. Log out. Log back in. You will now have a new Firefox-like icon in the distinctive Nightly build colors next to the standard build application launcher. When you run the program, the active icon association may jump over to the standard build, but that is the only glitch in the whole story. Changing the file name does not affect it.

Added new icon

Added new icon, zoomed

Firefox, standard

Firefox, nightly

New launcher works

Add to system menu

To make our little task complete, we will also edit the system menu and add Firefox 57 as a separate entry to the Internet category. This way, the program actually shows in the list, and that makes it all nice and professional like.

Add new system menu entry

System menu

Conclusion

Another Plasma thingie nailed. This is an innocent tweak, and it won't make you richer, but it may tame the OCD demons in your soul. Having multiple launchers for different application versions make sense, or at the very least, it should be possible. I still do not know all the details how Plasma groups programs, but once I figure that one out, there won't be even the small panel active-app highlight glitch that we have now.

Hopefully, you find this trick as refreshing and unique as the custom WINE launchers. Plasma is highly configurable, and it's so delightful to use. The only shame is that you must dig under the hood for some of the obvious stuff. Well, something to look for in future releases. We're done here.

Cheers.

You may also like: