commit 1d56a18e566afa42af47adfe32ad224533343b30 parent ccfbdf3aceb05d52499bd20cb4af1ea454e467a7 Author: Tomas Hlavaty <tom@logand.com> Date: Sun, 21 Jun 2020 00:18:47 +0200 better framebuffer-screenshot file prompt Diffstat:
M | emacs-framebuffer.el | | | 15 | +++++++++++++-- |
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/emacs-framebuffer.el b/emacs-framebuffer.el @@ -38,6 +38,11 @@ :type 'number :group 'framebuffer) +(defcustom framebuffer-screenshot-directory nil + "Specify the diretory where to store screenshot files." + :type 'string + :group 'framebuffer) + (defcustom framebuffer-draw-delay "1 sec" "Specify the delay after which to draw on the framebuffer." :type 'string @@ -354,8 +359,14 @@ (let ((coding-system-for-write 'raw-text-unix)) (write-region (point-min) (point-max) "/dev/fb0")))))))) -(defun framebuffer-screenshot (&optional file) - (interactive "FFile: ") +(defun framebuffer-screenshot (file) + (interactive + (list + (read-string "File: " + (expand-file-name + (format-time-string "screenshot-%Y%m%d-%H%M%S.ppm") + (or framebuffer-screenshot-directory + (temporary-file-directory)))))) (destructuring-bind (w &rest h) (framebuffer-size) (destructuring-bind (vw &rest vh) (framebuffer-virtual-size) (with-temp-buffer