Closed MichaelBrunn3r closed 3 months ago
Did anyone manage to fix this issue? I am having the same problem but with multiple apps and it is annoying. I did manage to fix this once before reinstalling NixOS but I did it by doing random stuff and hoping something might work so I do not even remember what could have fixed it.
Make sure your application is correct (check the .desktop file in store). E.g. for Nautilus it was org.gnome.Nautilus.desktop
in my case.
Make sure your application is correct (check the .desktop file in store). E.g. for Nautilus it was
org.gnome.Nautilus.desktop
in my case.
I can confirm that the desktop file I was using was correct. Despite that the problem still remained. Right now however, the problem got magically fixed and I am not sure how. I was just reinstalling dolphin and kate and some dependencies for them (I do not want to use plasma) and somehow it magically started working. I checked xdg-open and now it only checks for mimelist inside my home directory which I believe is the desired result.
I am not sure if this even fixed it but I guess I will leave it here just in case it really does. I was using a mix of kdePackages and libsForQt5 packages but after I switched everything to libsForQt5 (kdePackages are bugged for me for whatever reason) it started working. Here is the list of the packages.
libsForQt5.ffmpegthumbs
libsForQt5.qtwayland
libsForQt5.qtsvg
libsForQt5.kiconthemes
libsForQt5.kdf
libsForQt5.kio-extras
libsForQt5.kio-admin
libsForQt5.plasma-integration
libsForQt5.kdegraphics-thumbnailers
libsForQt5.kservice
libsForQt5.kfind
libsForQt5.kdbusaddons
libsForQt5.kfilemetadata
libsForQt5.kconfig
libsForQt5.kcoreaddons
libsForQt5.kguiaddons
libsForQt5.ki18n
libsForQt5.kitemviews
libsForQt5.kwidgetsaddons
libsForQt5.kwindowsystem
libsForQt5.kate
libsForQt5.dolphin
shared-mime-info
Maybe it was kde packages that interfered with the mime stuff.
I made a mistake in my config and the issue of xdg-open searching many random files came back. I simply had a typo where instead of "firefox.desktop" I put "fifirefox.desktop". Although I had no typos before fixing the issue for the first time, maybe it might help in identifying the core issue.
[Removed Associations]
inode/directory=codium.desktop
You're probably looking for something like this, if you're using xdg-open
(replace codium
with whatever the desktop file is named as in vscode). Anyway this isn't really what I'd call a bug, just need to read https://wiki.archlinux.org/title/XDG_MIME_Applications and https://wiki.archlinux.org/title/Default_applications and configure accordingly.
[Removed Associations] inode/directory=codium.desktop
You're probably looking for something like this, if you're using
xdg-open
(replacecodium
with whatever the desktop file is named as in vscode). Anyway this isn't really what I'd call a bug, just need to read https://wiki.archlinux.org/title/XDG_MIME_Applications and https://wiki.archlinux.org/title/Default_applications and configure accordingly.
This doesn't fix anything. The problem is that when you use specific apps then xdg-open instead of searching for the proper file it goes around everywhere until it finds a cache file with incorrect values. What you suggested in that case won't fix the issue because xdg-open won't even search for the generated mimelist file in the first place.
When functionality breaks because of something and the only way to fix it is by removing the culprit then I believe that it indeed is a bug.
Considering I use vscodium (a vscode fork, which has the same behaviour in this scenario) daily without having such issues, as I set my default handler for directories to be Thunar, and do so without changing the packaging for vscodium.
$ xdg-mime query default inode/directory
thunar.desktop
Misconfiguration is user error, and not a bug.
Considering I use vscodium (a vscode fork, which has the same behaviour in this scenario) daily without having such issues, as I set my default handler for directories to be Thunar, and do so without changing the packaging for vscodium.
$ xdg-mime query default inode/directory thunar.desktop
Misconfiguration is user error, and not a bug.
The problem happened when I installed the application without changing anything. I used vscodium-fhs so maybe this package specifically ruins something but I don't use it anymore. I really don't see how installing an application and doing nothing else is user error. I can test that specific package once again when I come home.
Just like mentioned before, the issue is that xdg-open does not search for the correct file when using a specific app, in this case it was vscode for Michael and vscodium-fhs for me.
Also, I don't think it's wise to change default application imperatively when it's already being done declaratively through mimeApps option.
The problem happened when I installed the application without changing anything.
If you have multiple apps that can handle a given MIME type, you'd have to configure which one you prefer, that's a given. Instructions on how to do so were provided above. Otherwise the system is just guessing which one you want, seems like xdg-* uses alphabetical order by default.
I don't think it's wise to change default application imperatively
The config mentioned above is the desired target config, so you can use whichever module (NixOS or HM or whatever) to achieve that target config. MichaelBrunn3r
showed how two examples of how to do so in their original post.
Describe the bug
VSCode is set as the default application for the mime type
inode/directory
. This can't be changed.Steps To Reproduce
Steps to reproduce the behavior:
vscode
,vscode-fhs
orvscode.fsh
toconfig.environment.systemPackages
or user packagesxdg-mime query default inode/directory
->code.desktop
xdg-mime default nautilus.desktop inode/directory
xdg-mime query default inode/directory
-> Stillcode.desktop
Expected behavior
xdg-mime default nautilus.desktop inode/directory
and the two alternate configurations should change the default application.Additional context
I used the command
XDG_UTILS_DEBUG_LEVEL=2 xdg-mime query default inode/directory
to find out more about this issue. All files that home-manager orconfig.xdg.mime
configure contain the expected entries:~/.config/mimeapps.list
/etc/xdg/mimeapps.list
Here is the full output of running
XDG_UTILS_DEBUG_LEVEL=2 xdg-mime query default inode/directory
:Of the listed files only
~/.config/mimeapps.list
,/etc/xdg/mimeapps.list
and/etc/profiles/per-user/michael/share/applications/mimeinfo.cache
exist./etc/profiles/per-user/michael/share/applications/mimeinfo.cache
This seems to be the culprit. But it is a read-only file, idk how to configure it with Nix. I also tried everything again with
org.gnome.nautilus.desktop
andnautilus
as the default app, same result.Notify maintainers
@eadwu @Synthetica9
Metadata