org-download

a fork of abo-abo's org-download
git clone https://git.trogloxene.org/org-download.git
Log | Files | Refs | README

commit a45ee87383aeb6a5279b63eca8a035c169d0f9b6
parent b860afbb919d5aa00f7c547f4c81e02b9a748071
Author: Oleh Krehel <ohwoeowho@gmail.com>
Date:   Thu, 31 Oct 2013 16:22:57 +0100

org-download.el (org-download-screenshot): new function.

* org-download.el (org-download-scrot): removed in favor of `org-download-screenshot'
  (org-download-gnome-screenshot): removed in favor of `org-download-screenshot'
  (org-download-screenshot-method): new custom variable.

Diffstat:
Morg-download.el | 29++++++++++++-----------------
1 file changed, 12 insertions(+), 17 deletions(-)

diff --git a/org-download.el b/org-download.el @@ -104,6 +104,14 @@ Set this to \"\" if you don't want time stamps." :type 'string :group 'org-download) +(defcustom org-download-screenshot-method "gnome-screenshot -a -f %s" + "The tool to capture screenshots." + :type '(choice + (const :tag "gnome-screenshot" "gnome-screenshot -a -f %s") + (const :tag "scrot" "scrot -s %s") + (const :tag "gm" "gm import %s")) + :group 'org-download) + (defun org-download-get-heading (lvl) "Return the heading of the current entry's LVL level parent." (save-excursion @@ -209,25 +217,12 @@ COMMAND is a format-style string with two slots for LINK and FILENAME." (interactive) (org-download-image (current-kill 0))) -(defun org-download-scrot () - "Call \"scrot -s\" and insert the resulting file. -scrot supports: -1. capture window: single click -2. general area: mouse drag" +(defun org-download-screenshot () + "Capture screenshoot and insert the resulting file. +The screenshot tool is determined by `org-download-sceenshot-method'." (interactive) (let ((link "/tmp/screenshot.png")) - (shell-command (format "scrot -s %s" link)) - (org-download-image link))) - -(defun org-download-gnome-screenshot (arg) - "Call gnome-screenshot and insert the resulting file. -Without a prefix argument screen area is selected with the mouse. -With a prefix argument grab the entire screen." - (interactive "P") - (let ((link "/tmp/screenshot.png")) - (shell-command (format "gnome-screenshot %s -f %s" - (if arg "" "-a") - link)) + (shell-command (format org-download-screenshot-method link)) (org-download-image link))) (defun org-download-image (link)