Zotero stopped opening from launcher / application pane
Hi there,
Zotero stopped opening on my laptop from the launcher / application pane. I use Debian Testing with GNOME desktop. Presumably a recent package update caused it to stop working, but not sure which. The error when I try and launch it is:
Failed to launch "Zotero"
Desktop file didn't specify Exec field
The Exec line of zotero.desktop currently looks like (unchanged):
Exec=bash -c "$(dirname $(realpath $(echo %k | sed -e 's/^file:\/\///')))/zotero -url %U"
I can still start from the terminal, e.g. by typing /opt/zotero/zotero. If I copy and paste the right hand side of the Exec line in zotero.desktop into the terminal, that also works (if I run it from the /opt/zotero folder).
I have tried changing the Exec line in zotero.desktop in various ways, e.g. to "Exec=/opt/zotero/zotero" etc., but to no avail.
I also tried reinstalling it from the tarball following precisely the instructions on the website: https://www.zotero.org/support/installation (also to no avail)
Any ideas about how to fix this?
Thanks,
Sean
Zotero stopped opening on my laptop from the launcher / application pane. I use Debian Testing with GNOME desktop. Presumably a recent package update caused it to stop working, but not sure which. The error when I try and launch it is:
Failed to launch "Zotero"
Desktop file didn't specify Exec field
The Exec line of zotero.desktop currently looks like (unchanged):
Exec=bash -c "$(dirname $(realpath $(echo %k | sed -e 's/^file:\/\///')))/zotero -url %U"
I can still start from the terminal, e.g. by typing /opt/zotero/zotero. If I copy and paste the right hand side of the Exec line in zotero.desktop into the terminal, that also works (if I run it from the /opt/zotero folder).
I have tried changing the Exec line in zotero.desktop in various ways, e.g. to "Exec=/opt/zotero/zotero" etc., but to no avail.
I also tried reinstalling it from the tarball following precisely the instructions on the website: https://www.zotero.org/support/installation (also to no avail)
Any ideas about how to fix this?
Thanks,
Sean
I managed to fix this issue, although I'm still not sure what exactly was causing it. To fix it I did:
1. Changed the Exec field of zotero.desktop to the full path to zotero, in my case:
Exec=bash -c /opt/zotero/zotero
2. Copied the zotero.desktop file to ~/.local/share/applications/, rather than symlinked it. In my case:
cp /opt/zotero/zotero.desktop ~/.local/share/applications/
Sean
However I believe the step 2 is unnecessary
zotero
script will work.I then edited the .desktop file following [sean.canavy](https://forums.zotero.org/discussion/comment/463650/#Comment_463650) and noticed that nothing g was changed. After that I deleted the file `~/.local/share/applications/zotero.desktop` (that pointed to the modified file in zotero installation directory) and ran `/opt/zotero/set_launcher_icon` but the new .desktop file was not created in the applications directory.
The program launched only after I have copied the `zotero.desktop`. I woundered why symlink did not performed.
set_launcher_icon
doesn't create a desktop file or install it into the launcher folder. All it does is update theIcon
line in the bundled .desktop file with the current absolute path.A symlink still works fine. You might have needed to delete and recreate it to get the system to re-read the desktop file, though.
1. change the line in the zotero.desktop file:
Exec=bash -c ~/myopt/zotero/zotero
2. copy the file to ~/.local/share/applications:
cp ~/myopt/zotero/zotero.desktop ~/.local/share/applications
Just changing the line and keeping the symlink did not work.
file:\/\/
in the Exec line:-Exec=bash -c "$(dirname $(realpath $(echo %k | sed -e 's/^file:\/\///')))/zotero -url %U"
+Exec=bash -c "$(dirname $(realpath $(echo %k | sed -e 's/^file:\\/\\///')))/zotero -url %U"
We've made this change for the next Z7 beta (84), and we'll push a new Z6 build with this change.
Exec
line. TheIcon
line is set byset_launcher_icon
.zotero.desktop
would actually require runningset_launcher_icon
again, because it would reset theIcon
path to just 'zotero.ico'. Changes to the desktop entry are very rare, so this doesn't come up very often, but I guess we need to update our tarball installation instructions to mention this.set_launcher_icon
again before posting, but it didn't work. Meanwhile, I restarted my computer and the icon reappeared.Exec=/bin/bash -c "bash -c "$(dirname $(realpath $(echo %k | sed -e 's/^file:\/\///')))/zotero -url %U""
And it works.
It seems the Exec need an absolute path to bash in Ubuntu 24.04.
Exec=bash -c "$(dirname $(realpath $(echo %k | sed -e 's/^file:\\/\\///')))/zotero -url %U"
in zotero.desktop, then run set_launcher_icon again, and then recreate the sym link.
Thanks!
```
Failed to launch "Zotero"
Desktop file didn't specify Exec field
```
As @sean.cavany said in the previous comment, I just changed the `Exec` to:
```
Exec=bash -c "$(dirname $(realpath $(echo %k | sed -e 's/^file:\\/\\///')))/zotero -url %U"
```
in `zotero.desktop` in `~/.local/share/applications`.
And the issue is resolved. Thank you.
set_launcher_icon
unless you made a copy of the desktop file elsewhere or aren't using the official tarball. (Our instructions say to symlink the file into ~/.local/share/applications, not copy it, so that it continues to receive updates.)