Skip to content

Instantly share code, notes, and snippets.

@myrjola
Created September 17, 2015 10:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save myrjola/9e03f63d3dda9adb839b to your computer and use it in GitHub Desktop.
Save myrjola/9e03f63d3dda9adb839b to your computer and use it in GitHub Desktop.
(defun my-org-screenshot (arg)
"Take a screenshot into a time stamped unique-named file in the
same directory as the org-buffer and insert a link to this file.
If arg is not nil scale down the image to fit to a smaller width"
(interactive "P")
(setq filename
(concat
(make-temp-name
(concat (buffer-file-name)
"_"
(format-time-string "%Y%m%d_%H%M%S_")) ) ".png"))
(call-process "screencapture" nil nil nil "-s" filename)
(when arg (call-process "convert" nil nil t "-resize" "500" filename filename))
(insert (concat "[[" filename "]]"))
(org-display-inline-images))
(defun eshell/deploy ()
"My deploy dir"
(eshell/cd (concat "/ssh:alasin:/opt/deployment/new/martin-fastorm/backend")))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment