nixos/modules/desktop/screenshot.nix

18 lines
497 B
Nix
Raw Permalink Normal View History

{
2025-12-12 04:02:55 +01:00
config,
lib,
2025-12-12 04:02:55 +01:00
pkgs,
...
}: let
2025-08-21 10:31:34 +02:00
screenshotPkg = pkgs.writeShellScriptBin "screenshot" ''
AREA=$(${lib.getExe pkgs.slurp} -d)
2025-08-25 08:07:11 +02:00
${lib.getExe pkgs.grim} -t ppm -g "$AREA" - | ${lib.getExe pkgs.satty} -f - --initial-tool=arrow --early-exit --copy-command=${pkgs.wl-clipboard}/bin/wl-copy --action-on-enter="save-to-clipboard" --disable-notifications
2025-08-21 10:31:34 +02:00
'';
in {
2025-12-12 04:02:55 +01:00
config = lib.mkIf config.fireproof.desktop.enable {
environment.systemPackages = [
screenshotPkg
];
};
}