Using a different PDF Viewer in Standalone in Linux
Hey folks. Been working with Zotero for about a week to see if it will suffice for a research group I'm in.
I can't find a way to change my pdf readers in Zotero Standalone, and all of the forum threads I've seen on the subject are talking about the in-firefox plugin. I'm sure this is relatively easy - any help?
(adamsmith, *cough*, you've mentioned that you also use linux and the standalone)
I can't find a way to change my pdf readers in Zotero Standalone, and all of the forum threads I've seen on the subject are talking about the in-firefox plugin. I'm sure this is relatively easy - any help?
(adamsmith, *cough*, you've mentioned that you also use linux and the standalone)
/usr/share/applications/defaults.list
the change is:
204c204
< application/pdf=AdobeReader.desktop
---
> application/pdf=kde4-okularApplication_pdf.desktop
I guess that should be the implementation for the local account. Except that it does not work on my installation of OpenSuse 13.1
I reverted the changes above and my default went back to Acroread.
Then I tested the following
~> less ~/.local/share/applications/defaults.list
/home/mborgnia/.local/share/applications/defaults.list: No such file or directory
~> echo application/pdf=kde4-okularApplication_pdf.desktop >> \ ~/.local/share/applications/defaults.list
~> cat ~/.local/share/applications/defaults.list
application/pdf=kde4-okularApplication_pdf.desktop
Standalone Zotero continues to open my pdf files in Acroread
Of course, all along
~> grep pdf ~/.local/share/applications/mimeapps.list
application/pdf=kde4-okularApplication_pdf.desktop
Reverted back the global variable as indicated above and Zotero opens Okular as expected.
So, I will stay with my solution for now.
As we say in Perl TMTOWTDI
Zotero uses the system's default PDF viewer. There's no easy way to change that.
The above is untrue. My system default PDF viewer is Okular. Any time I open a PDF, directly or from an application, it opens in Okular. The only exception is when I open a PDF from Zotero, in which case the PDF is opened in Adobe Reader. Zotero does not use my system default PDF viewer.
In any case, despite the inability to change the PDF viewer, I absolutely love Zotero!
In any case, I closed Zotero, deleted the "mimeTypes.rdf" file and restarted Zotero, to no avail (Zotero still used Adobe Reader instead of the system default PDF viewer).
I also repeated the above after having uninstalled/purged Adobe Reader from my system. This actually did cause Zotero to start using my system default viewer (Okular). However, I need Adobe Reader (only) for high-quality printing, as Okular's print quality is lacking. Therefore, I reinstalled Adobe Reader, and Zotero immediately went back to using it for viewing PDF files. Strangeness. :)
In any case, I can learn to live with Zotero's use of Adobe Reader to open PDF files (or, in the alternative, may try to come up with a hack as time permits). I appreciate the explanations and suggestions, guys!
gedit ~/.local/share/applications/mimeapps.list&
Replace AdobeReader.desktop to evince.desktop as shown below:
[Default Applications]
application/pdf=evince.desktop
Granted, one advantage to prioritizing xdg-open would be that it would make debugging this a lot easier than digging through the morass of potentially relevant config files that can be involved now.
https://bugzilla.mozilla.org/show_bug.cgi?id=694870
I have painlessly used xdg-open and other tools of the xdg-utils suite in both GNOME and KDE.
In both these desktop environments, xdg-open/xdg-mime is pre-configured to make the right choices, e.g. evince/nautilus on GNOME and okular/dolphin on KDE.
Unlike xdg-open, I have no idea how to get Zotero to open PDFs on my favourite PDF reader (PDFStudio). I tried everything mentioned in this thread.
I hope that Mozilla will fix nsIFile.launch() some day to properly use Freedesktop standards on linux.
All this may seem not surprising, but I was worried that after removing nautilus, Zotero may fail on "Show File".
Just why cannot the standalone client have a simple, understandable option for ordinary people which allows to define the pdf viewer?
I was able to solve it by using KDE's build-in file associations manager (System settings -> Applications -> File associations). There, under application/pdf, I originally had Okular, then Gimp, then LibreOffice Draw. I removed Gimp and Draw from this list, and after that, Zotero defaulted to Okular.
On the backend, it seems the KDE file associations program modifies the `~/.config/mimeapps.list` file. My new one looks like this (unfortunately, I didn't check what the old one looked like, but it was probably empty and deferred to the system default mimeapps.list file, wherever that is...):
``` ~/.config/mimeapps.list
[Added Associations]
application/pdf=okularApplication_pdf.desktop;
[Default Applications]
application/pdf=okularApplication_pdf.desktop;
[Removed Associations]
application/pdf=libreoffice-draw.desktop;gimp.desktop;
```
It seems Zotero is doing something sensible after all, and the documentation on the website (https://www.zotero.org/support/kb/file_handling_issues#pdfs_opening_in_wrong_application_on_gnulinux_systems) is out of date. Useful information on MIME types is available, as expected, from the Arch Wiki (https://wiki.archlinux.org/index.php/default_applications#XDG_standard).
Note that this definition for Okular (okularApplication_pdf.desktop) seems to be new to the latest version of Okular. Those of you with older versions should use whatever the appropriate `.desktop` entry is.
Yes, you can take a look at this: 1009846184. However, that one includes another problem I was trying to work through, which is that Zotero does not "see" all executable files in /usr/bin. Specifically, when I select "Custom..." in the preferences, I get the file selection dialog, but when I got to /usr/bin, to select 'evince', it is not there. It is there in my file system, but Zotero cannot seem to find it. This is very strange and I don't entirely understand it, but I think it has to do with the fact that I'm using a flatpak-based app version of Zotero. I think flatpak apps are sandboxed in some way that causes this.
1055367047 is another one with the preference just set to System Default. Less other cruft for you to wade through.
However, I have also tried setting the preference value to /usr/bin/xdg-open, which Zotero can find, and which I can be sure gives the right behavior, since I can test it, independently. And still Zotero gives me the dialog to choose an application rather than calling xdg-open. I don't understand that, either. Seems like Zotero isn't using the preference value at all, like it doesn't understand the value and is using some fallback method, or there exists a higher precedence preference that is set to 'always ask.'