nixos/modules/desktop/screenshot.nix
2025-12-12 04:02:55 +01:00

17 lines
497 B
Nix

{
config,
lib,
pkgs,
...
}: let
screenshotPkg = pkgs.writeShellScriptBin "screenshot" ''
AREA=$(${lib.getExe pkgs.slurp} -d)
${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
'';
in {
config = lib.mkIf config.fireproof.desktop.enable {
environment.systemPackages = [
screenshotPkg
];
};
}