I am trying to make gthumb the default when opening png files from the terminal

$ xdg-mime default ~/.gnome/apps/gthumb.desktop image/png

I created this symlink:

$ ls -l ~/.gnome/apps/gthumb.desktop
lrwxrwxrwx 1 gauthier gauthier 15 Jun 27 /home/gauthier/.gnome/apps/gthumb.desktop -> /usr/bin/gthumb

I expect xdg-mime query default image/png to return gthumb. Instead, it says:

$ xdg-mime query default image/png

Why doesn't setting default have the effect I expect?

1 Answer 1


Enabling debugging with the environment variable XDG_UTILS_DEBUG_LEVEL helped:

$ XDG_UTILS_DEBUG_LEVEL=2 xdg-mime default ~/.gnome/apps/gthumb.desktop 
make_default_kde: No kde runtime detected
make_default_generic /home/gauthier/.gnome/apps/gthumb.desktop image/png
Updating /home/gauthier/.local/share/applications/mimeapps.list
$ XDG_UTILS_DEBUG_LEVEL=2 xdg-mime query default image/png
Checking /home/gauthier/.config/mimeapps.list

The mimeapps.list used for setting vs reading defaults is not the same. Solution (thanks to a comment here):

rm ~/.config/mimeapps.list

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.