/qute-capture

Use org-mode with Qutebrowser

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

qute-capture

Qutebrowser userscript for filing the current webpage into an org-mode file

Implemented

  • Insert plain entries with page title and url under an arbitrary heading
  • Select an existing entry using dmenu and jump to that page
  • Basic regexp filtering – Display only those entries which contain a URL
  • Collect any selected text and the date visited
  • Edit the entry in your favourite text editor

Planned

  • The current version is feature complete, although the design could certainly be improved
  • Todo lists or other org features are a possibility if people are interested in them

Non-features

  • A complete interface to org-mode in Qutebrowser – My only use for this script is to unify bookmarks and my org lists.
  • A complete parser for bookmarkish data – Org is extremely free form, this is a great strength, but it means that some imposed structure must be accepted from non-interactive tools. Trying to accommodate every possible format a user might desire is impossible.

Installation

  1. Place this script in the ~/.local/share/qutebrowser/userscripts folder.
  2. Add a binding to your Qutebrowser config.py, e.g. I use config.bind(',b', 'spawn --userscript qute-capture read -f ~/read-later.org -H Read-Later)
    • Be careful about spaces and other odd characters, if in doubt, wrap it in escaped quotes.
    • Alternatively, see 3. below.
  3. (Optional) To make invocation simpler edit the script to point ORG_FILE, HEADING_PATH, and EDITOR to the right places.
    • The default file+heading is ~/read-later.org+Read Later
    • The default editor is vi in xterm. Probably not what you want as org-user.

Use

  • To create a new entry: qute-capture write
    • To invoke an editor on the new bookmark before saving use the -e flag. -e takes an option argument which is a shell command to be executed.
  • To jump to an entry: qute-capture read
  • To delete an entry: qute-capture rm
  • See the source for other settings

Dependencies

  • PyOrgMode – I recommend getting it from github, rather than pip
  • Dmenu
  • I hope Qutebrowser goes without saying

Acknowledgements

  • Qutebrowser, for being just about the only usable modern browser
  • qute-pass, from which I shamelessly copied chunks of code