From mboxrd@z Thu Jan 1 00:00:00 1970 From: Feng Shu Subject: Re: RFQ - new contribution - org-screenshot.el Date: Tue, 21 May 2013 23:36:11 +0800 Message-ID: <8738tgibv8.fsf@news.tumashu-localhost.org> References: <87mwru8f57.wl%max@openchat.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:60638) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ueock-0006i4-2a for emacs-orgmode@gnu.org; Tue, 21 May 2013 11:37:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ueocf-0003UB-0l for emacs-orgmode@gnu.org; Tue, 21 May 2013 11:37:13 -0400 Received: from mail-pd0-f181.google.com ([209.85.192.181]:60053) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ueoce-0003Tx-QS for emacs-orgmode@gnu.org; Tue, 21 May 2013 11:37:08 -0400 Received: by mail-pd0-f181.google.com with SMTP id p11so738403pdj.26 for ; Tue, 21 May 2013 08:37:07 -0700 (PDT) Received: from tumashu ([175.49.154.76]) by mx.google.com with ESMTPSA id kr16sm3758031pab.23.2013.05.21.08.37.05 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 21 May 2013 08:37:06 -0700 (PDT) Received: from feng by news.tumashu-localhost.org with local (Exim 4.80) (envelope-from ) id 1Ueobj-0004Ki-5y for emacs-orgmode@gnu.org; Tue, 21 May 2013 23:36:11 +0800 In-Reply-To: (Haider Rizvi's message of "Tue, 21 May 2013 09:42:47 -0400") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Haider Rizvi writes: > Max Mikhanosha 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. Here is a > piece of code that was published earlier with a sample use. It's a good idea, "import" has nearly same feature as "scrot" and should work with org-screenshot ,it is included imagemagick https://wiki.archlinux.org/index.php/Taking_a_Screenshot > > 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, --