Initial commit
This commit is contained in:
29
screencap.el
Normal file
29
screencap.el
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
;;; Provided screenshot capability
|
||||||
|
(defun screencap-dwm ()
|
||||||
|
"Call dwm-screnshot and display filename in minibuffer."
|
||||||
|
(interactive)
|
||||||
|
(shell-command "dwm-screenshot"))
|
||||||
|
|
||||||
|
(defun screencap-el ()
|
||||||
|
"take a screenshot with imagemagick and elisp"
|
||||||
|
(interactive)
|
||||||
|
(setq-local fn
|
||||||
|
(concat "/home/oc/Pictures/screenshot-"
|
||||||
|
(if (boundp 'screenshot-context)
|
||||||
|
(if (not (string-equal screenshot-context ""))
|
||||||
|
(concat screenshot-context "-")
|
||||||
|
"")
|
||||||
|
"")
|
||||||
|
(format-time-string "%Y-%m-%d-%H.%M.%S")
|
||||||
|
".png"))
|
||||||
|
(set-process-sentinel
|
||||||
|
(start-process "screenshot" "*screenshot*"
|
||||||
|
"import" "-verbose"
|
||||||
|
"-window" "root"
|
||||||
|
fn)
|
||||||
|
(lambda (p e)
|
||||||
|
(when (eq 0 (process-exit-status p))
|
||||||
|
(message fn)))))
|
||||||
|
|
||||||
|
|
||||||
|
(provide 'screencap)
|
||||||
Reference in New Issue
Block a user