diff options
author | shoshin <shoshin@cicadas.surf> | 2022-12-13 21:30:46 -0600 |
---|---|---|
committer | shoshin <shoshin@cicadas.surf> | 2022-12-13 21:30:46 -0600 |
commit | a2001f71346a0263a5be7364c925a10c021960ec (patch) | |
tree | c5eb0290c47a77e480b7da114a0caf4a0d0d37b9 | |
parent | 204f093105df43fb5266021eaa2599efac25908e (diff) |
Add: screenshot-svg command
-rw-r--r-- | shoshimacs.el | 11 | ||||
-rw-r--r-- | shoshimacs.org | 15 |
2 files changed, 26 insertions, 0 deletions
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 |