From a2001f71346a0263a5be7364c925a10c021960ec Mon Sep 17 00:00:00 2001 From: shoshin Date: Tue, 13 Dec 2022 21:30:46 -0600 Subject: Add: screenshot-svg command --- shoshimacs.el | 11 +++++++++++ shoshimacs.org | 15 +++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/shoshimacs.el b/shoshimacs.el index 4a0cdba..3d5659c 100644 --- a/shoshimacs.el +++ b/shoshimacs.el @@ -276,4 +276,15 @@ (package-install 'autothemer) +(defun screenshot-svg () + "Save a screenshot of the current frame as an SVG image. +Saves to a temp file and puts the filename in the kill ring." + (interactive) + (let* ((filename (make-temp-file "Emacs" nil ".svg")) + (data (x-export-frames nil 'svg))) + (with-temp-file filename + (insert data)) + (kill-new filename) + (message filename))) + (package-install 'windresize) diff --git a/shoshimacs.org b/shoshimacs.org index cc1529e..d58220a 100644 --- a/shoshimacs.org +++ b/shoshimacs.org @@ -1031,6 +1031,21 @@ for theme development. (package-install 'autothemer) #+end_src +** SVG Screenshot + +#+begin_src emacs-lisp +(defun screenshot-svg () + "Save a screenshot of the current frame as an SVG image. +Saves to a temp file and puts the filename in the kill ring." + (interactive) + (let* ((filename (make-temp-file "Emacs" nil ".svg")) + (data (x-export-frames nil 'svg))) + (with-temp-file filename + (insert data)) + (kill-new filename) + (message filename))) +#+end_src + ** windresize #+begin_src emacs-lisp -- cgit v1.2.3