2

I have Ubuntu Gnome installed and I am using i3wm. Everytime I double click a book in Calibre to open it it opens in Mendeley desktop.

This doesn't happen under Gnome.

Could you explain why this happens and how I can fix it?

user10853
  • 1,626

1 Answers1

1

The problem seems to be that xdg-open is misconfigured:

$ xdg-mime query default application/pdf
mendeleydesktop.desktop

Sure enough, if I run xdg-open some.pdf it opens with Mendeley. It seems that some applications use xdg-open while others don't.

According to this, the culprit should be in here:

$ cat /usr/share/applications/mimeinfo.cache | grep pdf
application/pdf=evince-previewer.desktop;gimp.desktop;evince.desktop;mendeleydesktop.desktop;
application/x-bzpdf=evince-previewer.desktop;evince.desktop;
application/x-ext-pdf=evince-previewer.desktop;evince.desktop;
application/x-gzpdf=evince-previewer.desktop;evince.desktop;
application/x-xzpdf=evince-previewer.desktop;evince.desktop;
image/pdf=display-im6.q16.desktop;display-im6.desktop;

Looks good to me, except GIMP being there; oh well.

$ cat .config/mimeapps.list | grep pdf
application/pdf=evince.desktop;inkscape.desktop;

Looks fine as well. So the problem could be in an i3-specific config file. But:

$ echo $XDG_CONFIG_DIRS
/etc/xdg/xdg-i3:/etc/xdg

The former folder does not exist, and the second does not contain any .list file.

So I have no idea where this comes from. But running

xdg-mime default evince.desktop application/pdf

does certainly fix it.

Raphael
  • 2,052