13

Directories keep opening in Firefox when I use xdg-open. I do not want this.

I did:

xdg-mime default dolphin.desktop application/x-directory

and

xdg-mime default dolphin.desktop inode/directory

Yet, when I try

xdg-open /local

I still get a firefox window. Why is this? I even double checked with

xdg-mime query default inode/directory

and

xdg-mime query default inode/directory

and both of those commands result in

dolphin.desktop

I don't know if it would make a difference If I have used ssh to control the machine that I am referring to (I am not working on the machine that I am giving these commands, I have used ssh to control it via the terminal of my current machine).

The default program for directories on the machine I am sitting at is File Browser, not dolphin or Firefox, so it seems irrelevant.

2 Answers2

13

In my case the change wouldn't work:

$ xdg-mime default evince.desktop application/pdf

Running with debugging on will show you the files queried:

$ XDG_UTILS_DEBUG_LEVEL=2 xdg-mime query default application/pdf
Checking /usr/local/share//applications/defaults.list and /usr/local/share//applications/mimeinfo.cache
Checking /usr/local/share//applications/defaults.list and /usr/local/share//applications/mimeinfo.cache
Checking /usr/share//applications/defaults.list and /usr/share//applications/mimeinfo.cache
libreoffice-draw.desktop

Looking in that last file (where the match was found) gave me a hint:

$ grep application/pdf /usr/share/applications/mimeinfo.cache
application/pdf=libreoffice-draw.desktop;gimp.desktop;org.gnome.Evince.desktop;inkscape.desktop;

It's not called evince.desktop anymore, now it's org.gnome.Evince.desktop!

Once again, now using the new name:

$ xdg-mime default org.gnome.Evince.desktop application/pdf

$ XDG_UTILS_DEBUG_LEVEL=2 xdg-mime query default application/pdf
Checking ~/.config/mimeapps.list
org.gnome.Evince.desktop

Much better!

Malvineous
  • 2,798
2

For me, further to running xdg-mime default caja.desktop inode/directory, it was running

update-desktop-database ~/.local/share/applications/

which finally updated the default application.

After this, running xdg-mime query default inode/directory now showed the new default application.