KDE .desktop files on Ubuntu

Hi, I am not sure how to solve this or even how to search for a solution.

I am using nix and home-manager basically as my package manager instead of apt. This works fine in Ubuntu.
In Kubuntu (installed with apt install kubuntu-desktop) I get an error an error when I try to launch most applications with Krunner or the application launcher, I get an error that the .desktop file is not writable.

I assume this is because KDE tries to add some things to the .desktop file because:

  • It works fine in Ubuntu (so I guess Gnome does not try to add this)
  • I can still launch the applications through the terminal and they work fine (except Firefox keeps asking to be made default and I keep saying yes, thinking this might be related)

So my questions are:

  • is this a known issue?
  • Is there a way to solve it without using a different launcher?

I am not sure about kubuntu but, generally speaking, kde shouldn’t write to your .desktop files when you launch them from krunner.

Do you have GTK_USE_PORTAL set globally or for that application? If so, that will cause this behavior. You can just tell firefox to stop checking to work around that.

@dalto thank you for the reply. I wonder why I getting that “.desktop file is not writable” error then :thinking: I’ll keep searching.

echo $GTK_USE_PORTAL shows, nothing. So I assume I don’t have it set. I set Firefox as the default browser in kcm and disabled the “always check if I’m the default browser” prompt in Firefox.


I tried Nix on Ubuntu and KDE Plasma is unable to use the .desktop files.

However, I noticed that the only working app is Firefox. The only difference between the Firefox .desktop file and others is that the file is executable. Do you think I should open an issue somewhere?

For others, I do this simple workaround:

cp -L ~/.nix-profile/share/applications/* ~/.local/share/applications/

I am having the same problem and is also lost as to how to solve it

Searching some more, I found some GitHub issue which talks about this problem

I still did not find a solution :frowning: my current workaround is to run this one-liner when I encounter the error

find ~/.nix-profile/share/applications/ -iname '*.desktop' | xargs -n 1 readlink | xargs chmod +x

I have, however, found that this problem doesn’t exist on a pure NixOS with KDE Plasma desktop environment.