Tuesday, September 29, 2015

KDE Plasma 5 launchers not working in Gnome 3

Today I discovered that manually created KDE launchers (.desktop files in $HOME/.local/share/applications/) are not wholly compatible with Gnome 3.

I won't go into details, but instead will point you to this bug report: https://bugs.kde.org/show_bug.cgi?id=321152

I'm mainly interested in ensuring this work on my system as I regularly switch back and forth between KDE 5 and Gnome 3 (don't ask me why, we all have our oddities), and I need to ensure that Launcher icons are available under both desktop environments.

When creating entries with KDE Menu Editor, you will find that these files look somewhat similar to the example below, which I created to launch JMETER:

[Desktop Entry]
Comment=
Exec=java -jar /home/<...>/<...>/apache-jmeter-2.10/bin/ApacheJMeter.jar
Icon=applications-utilities
Icon=office-chart-line-percentage
Name=JMETER
NoDisplay=false
Path[$e]=
StartupNotify=true
Terminal=0
TerminalOptions=
Type=Application
X-KDE-SubstituteUID=false
X-KDE-Username=


The highlighted line, Path[$e]=... is actually the cause of Gnome not displaying the launcher in it's menu. 

Simply adding a pound comment (#) symbol in front of it will allow Gnome to ignore that line and the launcher will function.

 ...
#Path[$e]=
 ...

When you have several such entries, it is easier to use SED in conjunction with FIND to edit all of them at once.
1
find . -type f -exec sed -i 's/Path\[/#Path\[/g' {} \;
It's not the most elegant solution... but it works... sort of... 

No comments:

Post a Comment