Someone had found the reason this was broken AND described their fix on a public git repo on Github, which no doubt has saved me millions of hours: https://github.com/n4zz/Fix-Dolphin-File-Associations
I’ll just be recounting the steps I took following the quick steps described in their repo, mainly so I always have this reference for myself incase it is ever deleted, etc, so you can just follow the link and the steps there (look out for the small typo when renaming the menu file on their repo).
Currently I am on Arch Linux, using Hyprland (v0.54.3) with KDE6 installed (Frameworks 6.25.0). The exact versions probably don’t matter much, but if you are very far in the future and it’s still broken for you, take care as commands could be different.
The quick fix
-
First we install
archlinux-xdg-menufrom the extra repository.yay archlinux-xdg-menu -
Navigate to
/etc/xdg/menusand ensure the filearch-applications.menuexists.cd /etc/xdg/menus -
Rename
arch-applications.menutoapplications.menu.sudo mv arch-applications.menu applications.menu -
Rebuild cache from scratch for
KServiceto use.kbuildsycoca6 --noincrementalNote: In the future, whenever you change menu or .desktop files, just run
kbuildsycoca6to include your changes in the cache. -
Check
mimeapps.listis correct.vim ~/.config/mimeapps.listMake sure that you replace invalid entries with correct ones (eg:
text/plain=kate6;should betext/plain=org.kde.kate.desktop;).Importantly, ensure all lines end with a semicolon
;.
It should work now! If not: Try logging out and back in again, I didn’t have to do that so I don’t know if that would even do anything (potentially could if some process was stuck or something I dunno, worth trying before pulling your last hair follicule out).
Result
Dolphin should remember file associations now and be able to open files with their default applications.
You should also notice that the empty list you were given when asked to pick an application to open the file with is now correctly populated with all of your apps, so it’s much easier to change the default app through dolphin whenever needed (and actually works when you tick the Remember tick box).
Anyways, be thankful to n4zz for posting their fix
(I am btw)! If you are still having problems, go to their repo and try following the full steps (I haven’t described the full steps here because they were unnecessary for me so I wouldn’t be able to verify the steps personally).
No more suffering for mee!!!