mronkko / ZoteroQuickLook

Implements QuickLook in Zotero
748 stars 82 forks source link

Add preliminary support for sushi #42

Closed soraxas closed 2 years ago

soraxas commented 2 years ago

This attempts to close #23.

Currently I can confirm that this works for me in Linux by sending dbus message to preview files in Zotero via sushi. This support is preliminary because I had only added code path to sushi in the Perl script (i.e. the usefilenameworkaround flag).

The reason is that the actual js viewerExecutable is a bit messy and it currently:

  1. Supply necessary args by relying on appending args via the viewerBaseArguments list. However, this does not works for sushi as it need to embed the file path in part of its argunment to dbus-send.
  2. Code in js attempts to support opening multiple files. However, this is not possible in sushi AFAIK.

So the current PR attempt works with default settings (i.e. using the external perl script); however, has no effect if usefilenameworkaround flag is set to false.

bwiernik commented 2 years ago

Thanks!

YaoLiMuMu commented 1 year ago

@soraxas i find that sushi do make a preview, but it it is similar to run a command which is "sushi FILENAME" in shell. it turn out that the preview window does not have focus and is buried under Zotero mainwindow. Have you ever encountered this situation?

lbc1027 commented 1 year ago

你好,邮件已收到,我会尽快处理,如有急事请联系13547906739

soraxas commented 1 year ago

I haven't use it recently so I'm not too sure, but as far as I recall, I think sushi FILENAME is indeed the approach used in the PR.

From my vague memory, I think it's because arugnment list is somehow hard coded in the original implementation, and I didn't spent too much time to unravel it.

Do you expect sushi to be launched in some other manner?

YaoLiMuMu commented 1 year ago

@soraxas sushi can be active by commanding /usr/bin/sushi or send Dbus session, these two ways both couldn't make preview window get focus something, I have submitted an issue in gitlab Gnome-sushi [Link], the developers are still unable to determine the problem. Long story short. X11 window management is confusing, Sushi preview process always continue to run in the background for tens of seconds even if you have closed the preview window. This process will affect new preview file window to get focus. Simple solution is install the gnome extension (steal my focus) to force all new window immediately into focus. I will pull new request to solve this happy accident.