all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Viktor Rosenfeld <listuser36@gmail.com>
To: Haider Rizvi <harizvi@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: RFQ - new contribution - org-screenshot.el
Date: Tue, 21 May 2013 19:40:14 +0200	[thread overview]
Message-ID: <20130521174014.GA56422@client199-78.wlan.hu-berlin.de> (raw)
In-Reply-To: <m1ppwk1maw.fsf@gmail.com>

Hi,

Haider Rizvi wrote:

> Max Mikhanosha <max@openchat.com> writes:
> 
> > Hi All,
> >
> > I've been writing some documentation in OrgMode with screenshots, and
> > as with any screenshot taking, it takes a while to get one just right.
> >
> > A few tiny helper utilities, quickly snowballed into this :-) It may
> > need some cleanup, but IMHO its too awesome not to share it with the
> > list.
> >
> > To try it out, you'll need /usr/bin/scrot which is available as
> > "scrot" package on most distributions.
> 
> Cool. Can you make this a bit portable. On Mac OSX, the utility is
> called screencapture, and can be run with the same flags. 

Attached is a very first try at making org-screenshot run on OS X. Many
open issues remain:

- Clicking in a window will not take a screenshot using `screencapture
  -s' but aborts the process altogether and does not create a file. To
  capture a window one has to use `screencapture -w'. Another option is
  to use `screencapture -i' and toggle between window and selection mode
  using the space bar. The problem with this approach is that hitting
  the control key will place the screenshot into the clipboard and not
  create a file either.  
  
- Delay does not work because `screencapture -d' has a different
  meaning. To delay a screenshot, one has to use `screencapture -T'.

Cheers,
Viktor
  
> Here is a
> piece of code that was published earlier with a sample use.
> 
> http://thread.gmane.org/gmane.emacs.orgmode/69221/focus=69272
> 
> ,----
> | #+BEGIN_SRC emacs-lisp
> |   (defun paste-clipboard-to-file (&optional filename temp-dir)
> |     "Take a screenshot using the crosshairs and saveit to FILENAME,
> |     if it is given or to a temp file in the TEMP-DIR
> |     directory. Then add an orgmode style link at point."
> |     (interactive)
> |     (let* ((temporary-file-directory (or temp-dir "images"))
> |            (fname (or filename (make-temp-file "img" nil ".jpg"))))
> |       (call-process-shell-command (concat 
> |                                     "/usr/sbin/screencapture -s " fname))
> |       (insert "\n[[file:" fname "]]")
> |       (org-display-inline-images)))  
> |   ;;
> |   (global-set-key (kbd "C-c p") 'paste-clipboard-to-file)
> |   
> | #+END_SRC
> `----
> 
> Regards, 
> -- 
> Haider
> 
> 

  parent reply	other threads:[~2013-05-21 17:40 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-17  3:21 RFQ - new contribution - org-screenshot.el Max Mikhanosha
2013-05-17  6:13 ` Bastien
2013-05-17  7:38   ` Rainer M. Krug
2013-05-17 10:41     ` Max Mikhanosha
2013-05-17 12:33       ` Daniel F
2013-05-17 13:17       ` Feng Shu
2013-05-17 13:49       ` Bastien
2013-05-17 10:46     ` Carsten Dominik
2013-05-17 13:05     ` Carsten Dominik
2013-05-17 14:37       ` Max Mikhanosha
2013-05-17 13:27 ` Feng Shu
2013-05-17 16:25 ` Max Mikhanosha
2013-05-17 17:20   ` Brett Viren
2013-05-17 18:33     ` Max Mikhanosha
2013-05-17 19:42       ` Brett Viren
2013-05-20 16:53 ` François Pinard
2013-05-20 18:45 ` Russell Adams
2013-05-21  0:14   ` Max Mikhanosha
2013-05-21  0:58     ` Russell Adams
2013-05-21 12:03     ` François Pinard
2013-05-21 12:45       ` Russell Adams
2013-05-21 13:42 ` Haider Rizvi
2013-05-21 15:36   ` Feng Shu
2013-05-21 16:16     ` François Pinard
2013-05-21 17:40   ` Viktor Rosenfeld [this message]
2013-05-21 17:42     ` Viktor Rosenfeld

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130521174014.GA56422@client199-78.wlan.hu-berlin.de \
    --to=listuser36@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=harizvi@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.