doomemacs/bin/org-capture
Henrik Lissner d2d4166b42
Move lang/org => org/*
Since lang/org has grown (and is expected to grow much, much more), it
has been given its own module category.

Concerns #129, #138
2017-07-05 12:26:08 +02:00

29 lines
600 B
Bash
Executable File

#!/usr/bin/env bash
# Open an org-capture popup frame from the shell. This opens a temporary emacs
# daemon if emacs isn't already running.
#
# Usage: org-capture [key] [message...]
# Examples:
# org-capture n "To the mind that is still, the whole universe surrenders."
set -e
key="${1:-n}"
cleanup() {
emacsclient --eval '(kill-emacs)'
}
if ! pgrep emacs >/dev/null; then
emacs --daemon
trap cleanup EXIT INT TERM
fi
# TODO Allow piping from stdin
emacsclient -c \
-F '((name . "org-capture") (width . 70) (height . 25))' \
--eval "(+org-capture/dwim \"$2\" \"$key\")"