mikehardy / thunderlink

Link to your Thunderbird emails!
Mozilla Public License 2.0
42 stars 14 forks source link

Installation instruction on Linux #44

Closed paulmassen closed 4 years ago

paulmassen commented 5 years ago

Hi,

I can't manage to make it works by following the instructions from the README.md Clicking on a thunderlink, for example in orgmode result in an error message "no match" After further investigation, it seems like the mimeapps.list should now be stored in ~/.config/mimeapps.list as per the documentation: https://wiki.archlinux.org/index.php/XDG_MIME_Applications#mimeapps.list

Maybe the readme should be updated?

Also, is there any command that should be run after editing the mimeapps.list file in order to update the database?

Thanks for your help

mikehardy commented 5 years ago

Hi there! Sorry you've got trouble, but I've got no idea how to address it completely without versions of everything. For me, for example, as indicated in the README Ubuntu 18.04 (and now 18.10 and 19.04) work just fine using the docs. So no bug. But you've clearly got different versions. No idea with regard to commands to reinitialize your desktop environment, unfortunately - we've not had anyone using arch get it working and report how, that I know of

paulmassen commented 5 years ago

Hi! Many thanks for your quick answer. I got this from archlinux doc, but I'm actually using ubuntu.

I followed the doc exactly, but I did not manage to get it to work.

I tried several things, and read on some forum that one could nowadays place the .desktop file anywhere and then use desktop-file-install thunderbird-tl.desktop which somewhat seems to validate the .desktop file.

I did so, and it looks like the '%u'on the Exec line cause an error. I managed to remove this error by changing the line as below, i.e: wrapping it with a double quote and prefixing with sh -c

Exec=sh -c "/usr/lib/thunderbird/thunderbird -thunderlink '%u'"

Now the command output an error again:

error: action "Contacts" is defined, but there is no matching "Desktop Action Contacts" group
error: action "Compose" is defined, but there is no matching "Desktop Action Compose" group

Any idea? Many thanks again

paulmassen commented 5 years ago

Maybe it is related to my version of Thunderbird ? I'm running Version 60.6.1

paulmassen commented 5 years ago

Oh, after two days of research, I finally got it working actually. Here is what I did: Created a file on a folder named thunderbird-tl.desktop Added this:

[Desktop Entry]
Encoding=UTF-8
Name=Thunderlink Opener
Comment=Open specific Message-ID Thunderbird
Exec=sh -c "/usr/lib/thunderbird/thunderbird -thunderlink '%u'"
Terminal=false
X-MultipleArgs=false
Type=Application
Icon=thunderbird
Categories=Application;Network;Email;
MimeType=x-scheme-handler/thunderlink;
StartupNotify=true

Note how I removed the last line compared to this one: https://github.com/mikehardy/thunderlink/blob/master/integration/thunderbird-tl.desktop

I ran desktop-file-install thunderbird-tl.desktop

And now it works. Not sure about the consequence of removing the Actions line though...

mikehardy commented 5 years ago

Interesting. According to the spec: https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s11.html - those should simply be ignored if the implementor does not know what to do. Those Actions are useful for Thunderbird in general, but as they were just carried over to our thunderlink copy where we altered the exec line, and thunderlink does not handle calendar or compose, I think it is fine to remove them.

From the man page and help on desktop-file-install, looks like you might want to do a --rebuild-mime-info-cache as argument to desktop-file-install?

Finally, it looks like you used the quotes and removed the actions and that was the final thing that worked? I don't think you need to use the install command - you can still just drop the file in, but if you want to propose a PR that contains the updated desktop file and a note that you can just desktop-file-install, that'd be fine for me

paulmassen commented 5 years ago

From the man page and help on desktop-file-install, looks like you might want to do a --rebuild-mime-info-cache as argument to desktop-file-install?

I did not add this argument, and it seems like it worked

Finally, it looks like you used the quotes and removed the actions and that was the final thing that worked?

I think so indeed

but if you want to propose a PR that contains the updated desktop file and a note that you can just desktop-file-install, that'd be fine for me

As I'm not sure about the exact step, maybe we could leave this here, and see if it is of use to some other users before changing the instructions? Thanks again for your help

mikehardy commented 5 years ago

Ok - then for anyone reading this in the future - if you had trouble with the linux install and this helped, let us know, and maybe we can update the docs with our collective wisdom? Cheers!

nbeaver commented 5 years ago

I have some of my own notes I've had sitting around and didn't get around to publishing till now:

https://github.com/nbeaver/thunderlink-install-guide

It's a bit long, but feel free to let me know if/how you might want to integrate it into the official documentation. There's also an installer script that I haven't tested on anything but Ubuntu 18.04.

mikehardy commented 5 years ago

Hey @nbeaver that is great! In general I really like your tests in the relevant parts of the documentation, for positive confirmation that things are working. If you want to integrate that, excellent. In general all of it looked good with the only exception that it doesn't call it out explicitly make/model of linux Ubuntu 18 you are using, which means it will be confusing in 10 years when someone comes to look at it and assumes it's current. Any PRs you want to propose at all, please feel free, I'll probably merge right away. Alternatively, we could use the wiki feature here and then point to it from the README then it's really easy for people to edit / update and doesn't need PR merging etc

paulmassen commented 5 years ago

Hi @nbeaver I just did a fresh install of ubuntu, thunderbird and thunderlink, and I thought it was an opportunity to try your tutorial.

The command: thunderbird -thunderlink 'thunderlink://messageid=123456.789012@example.com' Correctly open the linked email.

However, on the next step, your commands mentions a thunderbird-thunderlink-handler.desktop whereas the file provided by this repo is thunderbird-tl.desktop Is that on purpose?

Also, it seems like all the above does not work on my install due to the fact that I installed thunderbird via snap, which means thunderbird is installed in /snap/bin/thunderbird

I will continue to investigate, but any advice is appreciated. Thanks!

nbeaver commented 5 years ago

Hi @paulmassen thanks for the feedback.

your commands mentions a thunderbird-thunderlink-handler.desktop whereas the file provided by this repo is thunderbird-tl.desktop

Either filename will work as long as the x-scheme-handler/thunderlink line in mimeapps.list matches it. My file happens to pre-date the one in the repo and I think the filename is more explicit about what it's doing, but I wouldn't be opposed to changing it for consistency.

Also, it seems like all the above does not work on my install due to the fact that I installed thunderbird via snap, which means thunderbird is installed in /snap/bin/thunderbird

That's an issue with the current version of the desktop file:

https://github.com/mikehardy/thunderlink/blob/3858fc36e84ff1333c02772191b997247a94b025/integration/thunderbird-tl.desktop#L5

It shouldn't be /usr/lib/thunderbird/thunderbird, it should just be thunderbird, like this:

https://github.com/nbeaver/thunderlink-install-guide/blob/ab2ccdcaa39eea6f053ba114501ddfc9205d1d8a/thunderbird-thunderlink-handler.desktop#L4

Here's the relevant part of the FreeDesktop standard:

The executable program can either be specified with its full path or with the name of the executable only. If no full path is provided the executable is looked up in the $PATH environment variable used by the desktop environment.

https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s07.html

You want the second one, where it's just the "name of the executable only", since as you've noticed full paths to executables are not always the same.

paulmassen commented 5 years ago

ah, that is exactly what I missed! Many many thanks, it works now!

RCheesley commented 5 years ago

Hi folks, thanks for the detailed descriptions, I've got this working perfectly if the link is in an email - click the link and it opens the email.

When it's in the description of a task (using AdvanceTasks to render html) clicking doesn't do anything - but clicking on a regular http link in the same markup syntax works fine.

Any ideas if I'm missing a step somewhere?

The context is I'm trying to get to a point where I can quickly create a task from an email with a link directly to the email itself (rather than the entire email in the description as 'convert to task' currently does). Currently I'm doing Thunderlink>Link with title, then right click>convert to task, deleting the content and replacing with the link.

Thanks!

nbeaver commented 5 years ago

@RCheesley You may want to start a new thread for your question, I'm starting to lose track of this one.

nbeaver commented 4 years ago

As the original request was fulfilled and the last comment was nearly a year ago, I'm closing this ticket.