Code Monkey home page Code Monkey logo

Comments (12)

retorquere avatar retorquere commented on July 21, 2024 3

I've been testing on a clean VM but apparently kept state between two tests. You're right -- after putting the desktop file in ~/.local/share/applications you still need to run xdg-mime default zotero.desktop x-scheme-handler/zotero for urls to work in FF. And it does look like the apt installation process does that for the mimetypes listed in the desktop file automatically.

from zotero-standalone-build.

retorquere avatar retorquere commented on July 21, 2024

It does (just tried again on a clean install of Ubuntu 20.04). It looks like the apt tools invoke xdg-mime default in some way.

from zotero-standalone-build.

dstillman avatar dstillman commented on July 21, 2024

Oh, so is it only on an apt install? The presence of the zotero.desktop file with that line in ~/.local/share/applications won't do it?

I'm basically asking if there's any reason to add this line to the stock desktop file in the tarball.

from zotero-standalone-build.

retorquere avatar retorquere commented on July 21, 2024

Turns out no; as long as the desktop file is in either /usr/share/applications or ~/.local/share/applications, xdg will find it. My debs were just putting them in /usr/shar/applications. Zotero has an install script that patches the desktop file, right? Might want to ln it to ~/.local/share/applications; ln will work (just tested).

edit: in which case the line in zotero.desktop does actually help:

$ xdg-mime query default x-scheme-handler/zotero
zotero.desktop

which works for any of the other mimetypes registered in de desktop file.

from zotero-standalone-build.

dstillman avatar dstillman commented on July 21, 2024

I'm saying that I added your MimeType line to the official zotero.desktop, did a normal ln -s into ~/.local/share/applications as per our official instructions, and I couldn't find a context where that did anything with the MimeType line.

What are you suggesting I do differently? How are you testing whether it works?

from zotero-standalone-build.

dstillman avatar dstillman commented on July 21, 2024

xdg-mime query default x-scheme-handler/zotero shows zotero.desktop for me, so I guess it's doing something, but a zotero://select link in Firefox (at least from a file:// URL) doesn't work, nor is Zotero offered when I go to Open With Other Application for a RIS file. So in what way is this doing something for you?

from zotero-standalone-build.

retorquere avatar retorquere commented on July 21, 2024

Except for file extensions it still does not work; looks like ris eg is not known by default.

from zotero-standalone-build.

inukshuk avatar inukshuk commented on July 21, 2024

In my experience, you need to run update-desktop-database after installing a new desktop file. This updates the cache database containing the list of MIME types handled by desktop files. If you use desktop-file-install to install the file you can also use the --rebuild-mime-info-cache option, but you may have to run update-desktop-database regardless.

I would assume that running xdg-mime default is something a user would do if there were multiple different applications handling the same type and that it should not be necessary if Zotero is the only application registered for the URL scheme.

To register unknown MIME types you can use xdg-mime install with a short XML file describing the type. Or copy the files yourself, e.g., to ~/.local/share/mime and update-mime-database afterwards. I think if your desktop file references the new MIME types you need to do this before update-desktop-database.

from zotero-standalone-build.

retorquere avatar retorquere commented on July 21, 2024

Yeah looks like it, means I have to re-add the postinst script.

from zotero-standalone-build.

karlicoss avatar karlicoss commented on July 21, 2024

Hi, anyone knows if this functionality is working? Also is there any doc on how it was meant to work -- couldn't find anything, except some references to zotero:// in the source code.

./zotero-bin --help doesn't show -url flag. Also, not sure if it was meant to be --url?

Exec=bash -c "$(dirname $(realpath $(echo %k | sed -e 's/^file:\/\///')))/zotero -url %U"

Either way, it doesn't really work -- grepped in the code for some examples of zotero:// URLS, like zotero://debug, but when I run ./zotero-bin --url zotero://debug, nothing happens? Or am I doing something wrong?

I'm using Zotero Beta, in case it matters.

from zotero-standalone-build.

baodrate avatar baodrate commented on July 21, 2024

@karlicoss this blog post describes some context that might be useful

from zotero-standalone-build.

wshanks avatar wshanks commented on July 21, 2024

I played around with x-scheme-handler/zotero in the context of wshanks/Zutilo#207 (opening zotero:// item links) and found that it did make a difference, so I would recommend adding it to zotero.desktop in this repo.

from zotero-standalone-build.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.