about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--users/tazjin/emacs/config/functions.el11
-rw-r--r--users/tazjin/nixos/frog/default.nix1
-rw-r--r--users/tazjin/nixos/modules/physical.nix2
3 files changed, 9 insertions, 5 deletions
diff --git a/users/tazjin/emacs/config/functions.el b/users/tazjin/emacs/config/functions.el
index f64907a591b6..23cb47d02a3b 100644
--- a/users/tazjin/emacs/config/functions.el
+++ b/users/tazjin/emacs/config/functions.el
@@ -241,11 +241,16 @@ the GPG agent correctly."
   (if prefix (text-scale-adjust 0)
     (set-face-attribute 'default nil :height (or to 120))))
 
-(defun scrot-select ()
+(defun screenshot-select (filename)
   "Take a screenshot based on a mouse-selection and save it to
   ~/screenshots."
-  (interactive)
-  (shell-command "scrot '$a_%Y-%m-%d_%s.png' -s -e 'mv $f ~/screenshots/'"))
+  (interactive "sScreenshot filename: ")
+  (let* ((path (f-join "~/screenshots"
+                       (format "%s-%d.png"
+                               (if (string-empty-p filename) "shot" filename)
+                               (time-convert nil 'integer)))))
+    (shell-command (format "maim --select %s" path))
+    (message "Wrote screenshot to %s" path)))
 
 (defun graph-unread-mails ()
   "Create a bar chart of unread mails based on notmuch tags.
diff --git a/users/tazjin/nixos/frog/default.nix b/users/tazjin/nixos/frog/default.nix
index 1400517eecbc..7abc24a958e2 100644
--- a/users/tazjin/nixos/frog/default.nix
+++ b/users/tazjin/nixos/frog/default.nix
@@ -262,7 +262,6 @@ lib.fix (self: {
       ripgrep
       rustup
       screen
-      scrot
       spotify
       tokei
       transmission
diff --git a/users/tazjin/nixos/modules/physical.nix b/users/tazjin/nixos/modules/physical.nix
index a068b9167bcf..0105d9f3a2a1 100644
--- a/users/tazjin/nixos/modules/physical.nix
+++ b/users/tazjin/nixos/modules/physical.nix
@@ -39,6 +39,7 @@ in
       imagemagick
       jq
       lieer
+      maim
       man-pages
       moreutils
       mosh
@@ -62,7 +63,6 @@ in
       rust-analyzer
       rustup
       screen
-      scrot
       thunderbird
       tig
       tokei