flathub / org.zotero.Zotero

https://flathub.org/apps/details/org.zotero.Zotero
21 stars 16 forks source link

Zotero cannot find TeXstudio #89

Closed qoheniac closed 2 years ago

qoheniac commented 3 years ago

The Better BibTex add-on has a feature to push citation keys to TeXstudio which does not work with this version of Zotero because it cannot find TeXstudio (I already mentioned that here). I'm no Flatpak expert. Can you tell me how I can allow Zotero to find TeXstudio (installed in the host system)?

qoheniac commented 2 years ago

I found a solution! I'm not a flatpak expert and so I'm not sure if this is the best way to do it, but it works and thus I wanted to share it in case anyone else has the same problem. So here is what I did:

BINPATH="$HOME/.zotero-bin"  # Should not be included in host's $PATH
mkdir -p "$BINPATH"
echo -e '#!/usr/bin/env sh\nflatpak-spawn --host texstudio "$@"' > "$BINPATH/texstudio"
chmod +x "$BINPATH/texstudio"
flatpak override --user --talk-name=org.freedesktop.Flatpak --filesystem="$BINPATH" --env=PATH="$BINPATH:/app/bin:/usr/bin" org.zotero.Zotero