Dolphin does not have MIME associations

Hello everyone.

I am on NixOS unstable with a flake-based setup. I am using Hyprland and do not have the plasma desktop installed.

The way I have dolphin currently installed is:

with pkgs; [
    kdePackages.dolphin
    kdePackages.kio
    kdePackages.kdf
    kdePackages.kio-fuse
    kdePackages.kio-extras
    kdePackages.kio-admin
    kdePackages.qtwayland
    kdePackages.plasma-integration
    kdePackages.kdegraphics-thumbnailers
    kdePackages.breeze-icons
    kdePackages.qtsvg #https://www.reddit.com/r/hyprland/comments/18ecoo3/dolphin_doesnt_work_properly_in_nixos_hyprland/
    kdePackages.kservice
    shared-mime-info
];

I have also tried installing via home-manager.

I also have in my configuration.nix:

  xdg.menus.enable = true;
  xdg.mime.enable = true;

The issue I am facing is that dolphin does seem to know about neither which applications are installed on the system nor with which MIME types they are associated with.

Arch Linux had the same issue a couple of months ago: arch forum

I have also come across:
link0 link1 link2

I have tried setting XDG_MENU_PREFIX=plasma- to no avail.

When opening dolphin or running kbuildsycoca6 after rm ¨/.cache/ksycoca* the error message
"applications.menu" not found in QList("/etc/profiles/per-user/n/etc/xdg/menus", "/run/current-system/sw/etc/xdg/menus") is displayed.

On another machine that is using the plasma desktop, the ... /sw/etc/xdg/menus directory contains a file called plasma-applications.menu. Here dolphin behaves as expected. On my install the directory only contains another empty directory applications-merged.

I tried to find out where the plasma-applications.menu file is generated, but a github search in the nixpkgs repo only yielded three results, all of them did not seem related. search

There is also a mimeapps.list at ~/.config/mimeapps.list which contains mimetype associations. Selecting Remember application association for all files of type […] and manually typing the name of the binary in the dropdown field adds an association to the file, though dolphin does not seem to notice.

This leads me to believe that there is an issue with the generated menus.
There was an issue before with broken menus Apps installed via Home Manager are not visible within GNOME
also issue, but in the github issue they were able to run kbuildsycoca.

I found out I had to install kdePackages.plasma-workspace to get the plasma-applications.menu file to appear. After clearing the cache, the file associations started working.

This solution is less than ideal, because I don’t particularly fancy installing half of KDE to just use their file manager.

It also forces me to stylix.targets.kde.enable = false, disabling all qt theming.
This is needed because stylix throws

An error occurred while attempting to set the Plasma wallpaper:
The name org.kde.plasmashell was not provided by any .service files

Hi there, I’m having a similar issue. Have you discovered any way to get stylix working with kde without disabling all qt themeing?

Edit: For others interested, see the following issues:

I actually did, though the solution I came up with is decidedly suboptimal.

I added

 # This fixes the unpopulated MIME menus
  environment.etc."/xdg/menus/plasma-applications.menu".text = builtins.readFile "${pkgs.kdePackages.plasma-workspace}/etc/xdg/menus/plasma-applications.menu";

to my config. This works, but pulls all of plasma into the system closure.

2 Likes

Sadly none of these seems to resolve the issue for me. Going crazy fighting XDG and KDE dolphin. Everything I do I seem to get further removed from a solution.

1 Like

Have you figured something out?

I had this same problem: flake-based setup + Hyprland + no plasma desktop + dolphin + empty applications list + “applications.menu” not found error when kbuildsycoca6.
But I installed them using Home Manager.

What I found out is that kbuildsycoca5 that comes with libsForQt5.service successfully runs, and dolphin could see my applications. And of course, the applications.menu was there at ~/.local/state/nix/profiles/profile/etc/xdg/menus/applications.menu. So I copied it, kept it in my config folder, and added

xdg.configFile."menus/applications.menu".text = builtins.readFile ./applications.menu;

and swapped back libsForQt5.kservice with kdePackages.kservice.

And voila, everything works as expected!!