1
1
Fork 1
mirror of https://github.com/oddlama/nix-config.git synced 2025-10-10 14:50:40 +02:00
oddlama_nix-config/pkgs/scripts/screenshot-screen.nix

24 lines
493 B
Nix

{
writeShellApplication,
grimblast,
libnotify,
}:
writeShellApplication {
name = "screenshot-screen";
runtimeInputs = [
grimblast
libnotify
];
text = ''
umask 077
date=$(date +"%Y-%m-%dT%H:%M:%S%:z")
out="''${XDG_PICTURES_DIR-$HOME/Pictures}/screenshots/$date-fullscreen.png"
mkdir -p "$(dirname "$out")"
grimblast --freeze save screen "$out" || exit 2
notify-send \
"📷 Screenshot captured" "💾 Saved to $out" \
|| true
'';
}