Create handler for zotero:// links

Hey guys,

a short question: I downloaded zotero from their website.

I then unpacked the archive and created a .desktop file at "/home/local/share/applications/ ".

Now I would like to open in applications like libreoffice, kate etc links of this kind “zotero://open-pdf/library/items/GDG4PK73?page=1” .

This should basically open a pdf-file at page 1 in okular.

But it doesn’t work and I have no idea how to register zotero as a handler for zotero:// .

I already modified the desktop to file so that it looks like this

"[Desktop Entry]
Name=Zotero
Exec=/home/Studium/Tools/Zotero_linux-x86_64/zotero
Icon=/home/.local/share/icons/Tela/scalable@2x/apps/zotero.svg
Type=Application
Terminal=false
Categories=Office;
MimeType=x-scheme-handler/zotero
"

But it still doesn’t work. The error message is "Unable to create io-slave. klauncher said: Unbekanntes Protokoll „zotero“ " , whereas “Unbekanntes Protokoll” translates to unknown protocol.

Super grateful for any help with this! Thank you very much in advance for your time and help!

1 Like

You didn’t install zotero! Delete it, open pamac, activate access to AUR and install it from there.

Thank you for your help! Unfortunately, it was installed before and didn’t work either. Nevertheless, I did as you said (again) and its still not working. I also modified the .desktop file again and added “MimeType=x-scheme-handler/zotero” , but I still get the same error message as before.

It sounds like you’re calling it from the web browser (as a plugin). Where have you seen (or tried) this type of invocation of zotero? If you install it as a browser plugin, does it work?

Thanks again for your reply!

Im trying to invoke the link from text-editor (zettlr in this case). The link itself is generated by extracting annotations from a pdf-file with zotfile. Zotfile is, thereby, creating a reference together with the link.

Unfortunately, I can add screenshots here :frowning: But in my editor it looks like this
(Keller 2011:43)
and when clicked
(Keller 2011:43](zotero://open-pdf/library/items/GDG4PK73?page=1))

So you have zotfile installed as a zotero plugin?

yes, exactly.

I never used it. I can’t help you any further. Maybe someone else can guide you.

Anyone?

Using Zotero from AUR for 2 years with Manjaro. Got no problem at all. Zotfile was working fine, but only for demo to students. Will look deeper and come back soon if I find something relevant
In french : ZotFile : un outil pour gĂ©rer vos PDF – Le blog Zotero francophone
Use deepl.com !
Now I remember, I used the iPad app long time ago to sync my library with it.

But Zotero Text plugin is only compatible with MS Word, LibreOffice and LateX AFAIK

I am facing the same issue.

first I installed using flatpak
then tried the snap
finally built from AUR and now clicking the link opens up zotero itself but not the intended pdf file.
I tried modifying the .desktop file but it still does not work.

Don’t really understand what you’re trying to do. Zotero is a bibliographic reference manager mainly, it can handle pdf as child records. My advice would be to manage your pdf with another software if you don’t need the integrated citation and bibligraphic fonctions Zotero offers.

I got both the select and Zotfile PDF opening links to work on my install (KDE version) today. I worked off of a Zotero support thread, which I can’t link here because forum rules. The solution is actually shockingly simple, considering I know we aren’t the only ones who have struggled for many hours over this.

What worked for me was, your .desktop exec entry should look something like this: Exec=/usr/bin/zotero --url %u
The --url %u ending allows xdg-open or whatever to pass on the link you are trying to get Zotero to open. Whereas, the default Zotero install, at least as I re-installed it from AUR this morning using yay, has the exec line end in %f, which keeps this information from being passed on to the Zotero binary.

I will say the PDF opening process sometimes dies opening some files but works rapidly with others, which I suspect has more to do with how bulky/messy the PDFs themselves are. Very much something over my head and pay grade, but I’m very happy just to have basic functionality for most of my files.

I hope this helps you out as much as it does me!

P.S. If you were hoping to use these links in Zim Wiki, that still won’t work because Zim is weird. You’ll have to switch to another note taking software that opens links without going through whatever nonsense Zim uses
good thing I was wanting to switch Obsidian anyway. :slight_smile:

1 Like

Can you please post your complete modified desktop file here? I actually thought that might work and tried it before, but it did not in my case. Thanks in advance.

For future noobs like me, you have to change the desktop entry in /usr/share/applications/. Previously I changed the one found under /usr/lib/zotero and obviously it didn’t work.

This is what I did, first type int the terminal
sudo vim /usr/share/applications/zotero.desktop

Then edit that file to look like

[Desktop Entry]
Type=Application
Name=Zotero
GenericName=Zotero Standalone. Is a free, easy-to-use tool to help you collect, organize, cite, and share your research sources.
Icon=zotero
Exec=/usr/bin/zotero --url %u
Categories=Office
Terminal=false
MimeType=x-scheme-handler/zotero
1 Like

This worked for me! As an aside, typically it’s better to create a .desktop override in your local application directory.

cp /usr/share/applications/zotero.desktop ~/.local/share/applications
vim ~/.local/share/applications/zotero.desktop #Do your edits
update-desktop-database
1 Like