From 8f0837a4b55ae2f44cc727cd42c7da90896264a1 Mon Sep 17 00:00:00 2001 From: alexion Date: Sun, 27 Sep 2026 10:07:58 -0400 Subject: [PATCH] feat(desktop): copy screenshots before annotation --- configs/nixos/modules/desktop/utilities/screenshot.nix | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/configs/nixos/modules/desktop/utilities/screenshot.nix b/configs/nixos/modules/desktop/utilities/screenshot.nix index ff33392..e3630c8 100644 --- a/configs/nixos/modules/desktop/utilities/screenshot.nix +++ b/configs/nixos/modules/desktop/utilities/screenshot.nix @@ -4,25 +4,27 @@ pkgs, ... }: -# Keyboard-driven screenshots that open in satty for annotation, then land in -# both the clipboard and a dated file. +# Keyboard-driven screenshots copy to the clipboard before Satty opens for +# annotation. Satty copies annotated screenshots when it saves them. let cfg = config.modules.desktop.utilities.screenshot; # NOLINT(let_order) user = config.user.name; grimblast = "${pkgs.grimblast}/bin/grimblast"; satty = "${pkgs.satty}/bin/satty"; + tee = "${pkgs.coreutils}/bin/tee"; wl-copy = "${pkgs.wl-clipboard}/bin/wl-copy"; xdgUserDir = "${pkgs.xdg-user-dirs}/bin/xdg-user-dir"; - # satty's copy action also saves, so one keystroke lands the shot in both the - # clipboard and a file. + # Copy the original screenshot before Satty opens. + # Satty copies and saves annotated screenshots when the user presses Enter. capture = target: pkgs.writeShellScript "screenshot-${target}" '' dir="$(${xdgUserDir} PICTURES)/Screenshots" mkdir -p "$dir" ${grimblast} save ${target} - \ + | ${tee} >(${wl-copy}) \ | ${satty} --filename - \ --output-filename "$dir/screenshot-%Y%m%d-%H%M%S.png" \ --copy-command ${wl-copy} \