commit 4775b7efeab314b93193ec95c317b4fa35633001 Author: pi-bot-01 Date: Thu Mar 26 01:01:07 2026 -0700 Initial commit diff --git a/screencap.el b/screencap.el new file mode 100644 index 0000000..b6b1bfb --- /dev/null +++ b/screencap.el @@ -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)