diff --git a/.gitignore b/.gitignore index 430649f..183b34b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ builds -github.token \ No newline at end of file +github.token +*.xpi +*.zoteroplugin diff --git a/README.md b/README.md index 286c1d9..be85c53 100644 --- a/README.md +++ b/README.md @@ -11,12 +11,23 @@ This plugin is not currently being actively maintained. It may not work with cur To install ZoteroQuickLook, download the latest version of `zoteroquicklook.zoteroplugin` from the Releases section of this GitHub repo. In **Zotero** (not in Firefox), open Tools -> Add-ons. Then drag the `zoteroquicklook.zoteroplugin` file onto the Zotero Add-ons window. +Note for __Zotero 6.0__: Replace `zoteroquicklook.zoteroplugin` above, download `zoteroquicklook.xpi` from the Release section then follow the instructions above. + ## Installing on Mac -On Mac, ZoteroQuickLook uses macOS's native QuickLook functionality. No additional steps are needed. +On Mac, ZoteroQuickLook uses macOS's native QuickLook functionality. Check path `/usr/bin/qlmanage` and make sure it exists. No additional steps are needed. ## Installing on Linux -On Linux, you must install [Gloobus-Preview](https://launchpad.net/gloobus-preview), a QuickLook-like preview software. On Ubuntu you can do this by running the following commands in terminal: +On Linux, considering that __Gloobus-Preview__ is unmaintained now, it is recommanded to install __Gnome Sushi__ as the QuickLook preview software first. Run the command below to install it in terminal: + +``` +sudo apt install gnome-sushi # Debian User +run sudo dnf install sushi # Fedora User +``` + +After the installation is complete, check path `/usr/bin/sushi` and make sure it exists. + +If you want to install [Gloobus-Preview](https://launchpad.net/gloobus-preview), a QuickLook-like preview software. On Ubuntu you can do this by running the following commands in terminal: ``` sudo add-apt-repository ppa:gloobus-dev/gloobus-preview @@ -24,6 +35,8 @@ sudo apt-get update sudo apt-get upgrade sudo apt-get install gloobus-preview ``` +After the installation is complete, check path `/usr/bin/gloobus-preview` and make sure it exists. + For other distributions and versions the installation might be different. diff --git a/TODO b/TODO new file mode 100644 index 0000000..9c3cd10 --- /dev/null +++ b/TODO @@ -0,0 +1,11 @@ +Bugs: +- Missing special character escapes, file names with special sysmbos like $m^{2}$.pdf cant preview +- + +Low-priority bugs: +- Unable to preview with in 10 seconds of Zotero just starting +- Sushi sometimes jump to Nautilus file preview window when Zotero select nothing and type to preview + +Ideas (to be validated): +- +- diff --git a/chrome/content/.zoteroquicklook.pl.swp b/chrome/content/.zoteroquicklook.pl.swp new file mode 100644 index 0000000..33848fd Binary files /dev/null and b/chrome/content/.zoteroquicklook.pl.swp differ diff --git a/chrome/content/zoteroquicklook.pl b/chrome/content/zoteroquicklook.pl old mode 100644 new mode 100755 index cd1c7c5..a700d18 --- a/chrome/content/zoteroquicklook.pl +++ b/chrome/content/zoteroquicklook.pl @@ -33,7 +33,13 @@ if (-e '/usr/bin/qlmanage') { exec('/usr/bin/qlmanage','-p',@files); } elsif (-e '/usr/bin/sushi') { # we pass an entire string, instead of a list of args, to `system` because dbus-send needs to run in an actual shell - $cmd = 'dbus-send --print-reply --dest=org.gnome.NautilusPreviewer /org/gnome/NautilusPreviewer org.gnome.NautilusPreviewer.ShowFile string:"file://%s" int32:0 boolean:false'; + # kill last process to prevent the new preview window from losing window focus + # grep command checks include 'Previewer' processes that causes a new process with a name containing 'Preview' and 'grep' to be spawned + # so we need grep with option -v to avoid kill itself + $awk_tmp = q{awk '{print $2}'}; + $kill_pid = "while [ ` pgrep -c -f org.gnome.NautilusPreviewer` -ge 2 ] ; do kill -15 ` ps aux | grep org.gnome.NautilusPreviewer | grep -v grep | $awk_tmp ` ; sleep 1.0e-2 ;done ;"; + $dbus_preview = 'dbus-send --print-reply --dest=org.gnome.NautilusPreviewer /org/gnome/NautilusPreviewer org.gnome.NautilusPreviewer.ShowFile string:"file://%s" int32:0 boolean:false'; + $cmd = join(" ", $kill_pid, $dbus_preview); # sushi only support viewing single file system sprintf($cmd,File::Spec->rel2abs($files[0])); } diff --git a/install.rdf b/install.rdf index b40a403..5f52aeb 100644 --- a/install.rdf +++ b/install.rdf @@ -4,7 +4,7 @@ zoteroquicklook@gmail.com 2 ZoteroQuickLook - 1.4.2 + 1.4.3 Mikko Ronkko Brenton M. Wiernik Quick Look Utility for Zotero. @@ -14,14 +14,14 @@ zotero@chnm.gmu.edu 4.0 - 5.* + 6.* juris-m@juris-m.github.io 4.0 - 5.* + 6.* diff --git a/linux_build.sh b/linux_build.sh new file mode 100755 index 0000000..3409b2d --- /dev/null +++ b/linux_build.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +zip -r ./zoteroquicklook.xpi chrome defaults install.rdf chrome.manifest -x .* diff --git a/update-altwindows.rdf b/update-altwindows.rdf index 97834fa..011cd11 100644 --- a/update-altwindows.rdf +++ b/update-altwindows.rdf @@ -5,12 +5,12 @@ - 1.4.2 + 1.4.3 zotero@chnm.gmu.edu 4.0 - 5.* + 6.* https://github.com/mronkko/ZoteroQuickLook/releases/download/1.4.2/zoteroquicklook.zoteroplugin @@ -18,7 +18,7 @@ juris-m@juris-m.github.io 4.0 - 5.* + 6.* https://github.com/mronkko/ZoteroQuickLook/releases/download/1.4.2/zoteroquicklook.zoteroplugin diff --git a/update.rdf b/update.rdf index 97834fa..011cd11 100644 --- a/update.rdf +++ b/update.rdf @@ -5,12 +5,12 @@ - 1.4.2 + 1.4.3 zotero@chnm.gmu.edu 4.0 - 5.* + 6.* https://github.com/mronkko/ZoteroQuickLook/releases/download/1.4.2/zoteroquicklook.zoteroplugin @@ -18,7 +18,7 @@ juris-m@juris-m.github.io 4.0 - 5.* + 6.* https://github.com/mronkko/ZoteroQuickLook/releases/download/1.4.2/zoteroquicklook.zoteroplugin