about summary refs log tree commit diff
path: root/tools/emacs/config
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2020-01-26T19·13+0000
committerVincent Ambo <tazjin@google.com>2020-01-26T19·13+0000
commita2d0b7f3998dded968074da1c282361d512d75a0 (patch)
tree196a8084bc50985bc76bb8fd3e2faa2c51428a49 /tools/emacs/config
parent29e1de2fd248ec4e152d5b0c83514fa57bcb0a33 (diff)
feat(emacs.d): Add interactive 'scrot-select' screenshot function r/458
Diffstat (limited to 'tools/emacs/config')
-rw-r--r--tools/emacs/config/functions.el6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/emacs/config/functions.el b/tools/emacs/config/functions.el
index dc7ac89d782d..1bec8ecd98a7 100644
--- a/tools/emacs/config/functions.el
+++ b/tools/emacs/config/functions.el
@@ -259,4 +259,10 @@
           (magit-status "~/depot"))
       (warn "notmuch failed to render the raw message buffer"))))
 
+(defun scrot-select ()
+  "Take a screenshot based on a mouse-selection and save it to
+  ~/screenshots."
+  (interactive)
+  (shell-command "scrot '$a_%s.png' -s -e 'mv $f ~/screenshots/'"))
+
 (provide 'functions)