Comment 43 for bug 1509562

Cosmin Saveanu (csaveanu) wrote :

A solution that involves minimal hacks, but applies to individual apps one by one is to change the XDG_CURRENT_DESKTOP variable only when launching the problematic programs.

For Kate, for example:

1. Copy the .desktop file (in Ubuntu 17.04, with XFCE, I also have KDE Plasma installed):
> cp /usr/share/applications/org.kde.kate.desktop ~/.local/share/applications/org.kde.kate.desktop

2. Open the file (for example):
> cd ~/.local/share/applications/
> gedit org.kde.kate.desktop

3. Change the launch line from
Exec=kde kate -b %U
 to
Exec=env XDG_CURRENT_DESKTOP=kde kate -b %U

4. Make the file executable (in the file properties through Thunar)

As the user launcher files have precedence over the system ones, this works. You might try also to use "gnome" as the value of the XDG_CURRENT_DESKTOP variable. I did not want to change it system-wide becaus it is set by XFCE to "XFCE".