From 424d3059325a4059faaa79c2c889f7aeadbbd517 Mon Sep 17 00:00:00 2001 From: Lucien Cartier-Tilet Date: Mon, 22 Nov 2021 12:46:06 +0100 Subject: [PATCH] [StumpWM, bin] better screenshot handling --- org/config/bin.org | 15 +++++++++++++++ org/config/stumpwm.org | 12 ++++++------ 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/org/config/bin.org b/org/config/bin.org index 88dad80..2ae8896 100644 --- a/org/config/bin.org +++ b/org/config/bin.org @@ -281,6 +281,21 @@ printf "^f2^f0%s" $UNREAD :END: ~pinfo~ is a utility that shows system information +** Post scrot script +:PROPERTIES: +:HEADER-ARGS: :shebang "#!/usr/bin/env sh" :tangle ~/.local/bin/post-scrot +:CUSTOM_ID: cli-utilities-Post-scrot-script-88ccl7t01aj0 +:END: +It is possible to call a script on the resulting image of a ~scrot~ +command. Not only do I want to move them to a specific directory, I +also want to be able to see them in ~sxiv~ in case I want to edit the +image, copy it or simply delete it (sometimes I take screenshots by +accident). +#+begin_src sh +mv "$@" ~/Pictures/Screenshots/ +sxiv -abfs f "$HOME/Pictures/Screenshots/$*" +#+end_src + ** sshbind :PROPERTIES: :HEADER-ARGS: :shebang "#!/usr/bin/env fish" :mkdirp yes :tangle ~/.local/bin/sshbind diff --git a/org/config/stumpwm.org b/org/config/stumpwm.org index 2d07530..187ba5d 100644 --- a/org/config/stumpwm.org +++ b/org/config/stumpwm.org @@ -1259,12 +1259,12 @@ Here’s the equivalent in Common Lisp. Let’s also create a keymap for screenshots. #+name: screenshot-keymap #+caption: ~*my-screenshot-keymap*~ -| Keychord | Function | -|----------+------------------------------------------------------| -| ~d~ | ~exec scrot -d 3 -e 'mv $f ~/Pictures/Screenshots'~ | -| ~s~ | ~exec scrot -e 'mv $f ~/Pictures/Screenshots'~ | -| ~S~ | ~exec scrot -s -e 'mv $f ~/Pictures/Screenshots'~ | -| ~g~ | ~exec scrot -e 'gimp $f; mv $f ~/Pictures/Screenshots'~ | +| Keychord | Function | +|----------+----------------------------------------| +| =d= | =exec scrot -d 3 -e 'post-scrot $f'= | +| =s= | =exec scrot -e 'post-scrot $f'= | +| =S= | =exec scrot -s -e 'post-scrot $f'= | +| =g= | =exec scrot -e 'gimp $f; post-scrot $f'= | Here’s the equivalent in Common Lisp. #+begin_src lisp