Registering Org-Protocol with XDG


Org-protocol is a cool way of exchanging information from external applications and Org-Mode. In the past I have used some ugly hacks to get org-protocol working on Linux. However I have now found a clean way of getting xdg-open (a tool for configuring default applications in Linux) to open org-protocol links and pass them to emacs. On Archlinux all I had to do was create the file /usr/share/applications/emacsclient.desktop with the following:

[Desktop Entry] 
Name=Emacs Client
Exec=emacsclient %u 

This is handy because now I can get Google Chrome/Chromium to open org-protocol and pass links to emacs. In order to do this I have a bookmarklet with the following as the bookmark:


Now when I click this bookmarklet it executes emacsclient and org-store-link to make the webpage link available in Emacs. To paste the link use org-insert-link