I have two WMs installed at the moment - Plasma 6 and Hyprland. In Plasma 6 on Dolphin, my file associations work fine, but on Hyprland they are totally gone:
Just tried it on a few other compositors (Wayfire, Niri). Seems like Dolphin’s file associations don’t work outside of Plasma in general at the moment. No issues with opening apps from other launchers, either.
As for KService, installing it declaratively had no effect, nor did the following command:
> kbuildsycoca6
kbuildsycoca6 running...
"applications.menu" not found in QList("/run/current-system/sw/etc/xdg/menus")
What that does is symlink files from any packages that contain those subdirectories into that location in /run/current-system. So the plasma-applications.menu file is created by some package, presumably installed as part of plasma.
This is likely why it only exists as plasma-applications.menu; whatever creates that file is probably a kde-specific script. If we can figure out what script that is, and why it is kde-specific, it’s probably not too hard to figure out what’s missing for your other desktop environments (and potentially fix this upstream).
Unfortunately, I can’t find it with a grep through nixpkgs. Could you ls -l /run/current-system/sw/etc/xdg/menus/plasma-applications.menu and give me the actual store path of the file?
Hmm, ok, that’s not what I expected. If you want to just have all the plasma menu entries duplicated to other desktops, you can do this:
environment.systemPackages = let
# I wish there was a `pkgs.mapLink` or something to do this
application-menu = pkgs.runCommandLocal "xdg-application-menu" { } ''
mkdir -p $out/etc/xdg/menus/
ln -s ${pkgs.kdePackages.plasma-workspace}/etc/xdg/menus/plasma-applications.menu $out/etc/xdg/menus/applications.menu
'';
in [
application-menu
]
But the intention is for these files to be desktop-specfic. That way you e.g. don’t use the plasma calculator app on GNOME (I don’t know if they both actually feature a calculator, I’ve been an edgy WM user for the last 15 years). The plasma one is likely incomplete too, and only contains specifically the plasma desktop applications.
The above is an ok workaround for now if that’s all you care about, but there’s definitely something missing on the NixOS end here.
Unfortunately I don’t know sufficiently what the actual intent is (as I say, edgy WM user with a pathological need to do it all themselves). I’d go digging into the file to see what it actually contains, maybe read some dolphin docs and read the spec in more detail, but I really haven’t a clue what ultimately you’re expecting to see in that window.
Would you mind opening an issue since you at least mostly know what’s wrong here?
Thanks! Sure thing. I’ll experiment with my system to see if maybe it works properly without KDE Plasma installed; could be an edge case with Plasma rather than Dolphin if so. Will elaborate further on the issue and link it here.
I suspect that Plasma 6’s Dolphin notices the category of file, and renders bigger icons accordingly based on items in the category.
However, now default apps open proper on Niri, and it seems to work fine.
I’ll mark your fix as the solution for now, until a proper fix comes along. Thanks again