Created an empty file in ~ called test.desktop. Ran xdg-mime default test.desktop inode/directory, which returned success (returned 0). After this, xdg-mime query default inode/directory returned caja-folder-handler.desktop instead of test.desktop. Why did it not change even tho it returned success? I also tried running the commands with superuser privilege, with no success. Also tried sudo update-desktop-database, which had seemingly no effect either.

  • Try with a desktop file that actually exists in .local/share/applications or /usr/share/applications/. Note that the argument after xdg-mime default is not a filename.
    – Devon
    Mar 22 at 16:47
  • @Devon this worked, i still think it's weird that it returns 0 when the file doesn't exist in those directories tho. Mar 22 at 17:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.