Integrating Org Protocol with Qutebrowser
I don’t have a good introduction today. So let’s just get to the post.
Org mode provides something called org protocol in order to let other applications be able to pass their data into the emacs server instance. We exploit this feature of emacs to write a little script which can capture stuff in org mode and store links from the browser.
“org-protocol intercepts calls from emacsclient to trigger custom actions without external dependencies." From org protocol documentation
Basically we can send some information through the org protocol to emacs server.
Make sure you start an emacs server in your config somewhere, since org protocol requires a server.
org-protocol is not loaded by default with org. So make sure you require it explicitely too.
Adding a handler for org protocol
You need to add the config given below to
All it says is, if there is an address we want to open that begins with
org-protocol:/ redirect it to the emacsclient. But in case emacs server is not open or there is no handler for the requested protocol, the url will be handled by the next defined handler which would be a web browser. So make sure your emacs server is running. You can find the available org protocols in the variable
Org Protocol Script
Save the script given below to
~/.local/share/qutebrowser/userscripts/org-protocol. And change permission to executable by
chmod +x ~/.config/qutebrowser/userscripts/org-protocol.
This script does require
xdo by baskerville. You should probably uncomment bspc line if you are using
I recommend adding a separate category for protocol in capture templates if you are going to be using org-capture protocol. One capture template that i have for org-protocol is given below.
Now that we have setup everything for the userscript to work. All we have to do is add the corresponding keybindings to qutebrowser.
Now capturing to org mode from qutebrowser should be a breeze. Please leave your comments below if you face any issues. Script can be found here in my config: .qutebrowser/org-protocol at master · SidharthArya/.qutebrowser