dotfiles/emacs.d/capture

23 lines
574 B
Python
Executable File

#!/usr/bin/env python
# -*- coding: utf-8 -*-
# windows: bind Y spawn mintty --nopin -w hide -e C:\\cygwin\\usr\\local\\bin\\capture.py {url};; yank -t
# gnu/linux: bind Y yank -t;; spawn capture {url}
#
# (setq org-capture-templates
# ...
# ("w" "Marcadors" entry (file "~/org/web.org")
# "* %x\n %U\n %c"
# :empty-lines 1)
# ...
# ))
from urllib import quote
from sys import argv, exit
from subprocess import call
url = quote(argv[1], safe='')
call(['emacsclient', 'org-protocol:/capture:/w/' + url])