A simple script that uses Rofi to search for and open PDF/DjVu attachments from Zotero.
The script requires Python 3.7 or above (and Rofi, obviously).
This repository was created for personal use, and bugs are to be expected. Make sure to keep backups of important files.
rofi-zotero.py [-p ZOTERO_PROFILE] [--rofi-args="ROFI_ARGS"]Simplest case, just run the script.
rofi-zotero.pyIf you have multiple zotero profiles use
the -p argument to specify the profile name:
rofi-zotero.py -p user_01To pass arguments to Rofi, use --rofi-args. Note when using this argument, it
is usually necessary to include an equal sign and quote, see example below.
Spaces can be included by escaping them with backslash (\):
rofi-zotero.py --rofi-args="-i -theme mytheme -m -1 -p prompt\ with\ space"To get a list of all options, use
rofi-zotero.py --helpTo customize the Rofi arguments, for example to specify the theme, use the
--rofi-args command-line argument.
Some formatting options (how the results appear in Rofi) currently do not have
corresponding command-line arguments. Instead, you can customize these using
the FORMAT variables at the top of rofi-zotero.py.
There are two similar projects with the same name:
- rolph-recto/rofi-zotero
- MatthijsMars/rofi-zotero (fork of the former)
Here are some notable difference from the abovementioned projects:
- The list of attachments is sorted.
- It is possible to open attached links (for example, created using ZotFile).
- This script can also deal with items with multiple attachments.
- It is easier to change the format of the list of attachments.
- More flexibility regarding the arguments passed to Rofi.
- Error message are shown for various situations, for example if an attachment is not found.
Some parts of the code are based on MatthijsMars/rofi-zotero and the original project rolph-recto/rofi-zotero.
