1
1
Fork 1
mirror of https://github.com/oddlama/nix-config.git synced 2025-10-10 23:00:39 +02:00

refactor(screenshots): use separate scripts package

This commit is contained in:
oddlama 2023-10-16 00:46:30 +02:00
parent 3e0e03fc31
commit 6e8aae7d8d
No known key found for this signature in database
GPG key ID: 14EFE510775FE39A
15 changed files with 216 additions and 109 deletions

View file

@ -0,0 +1,20 @@
{
writeShellApplication,
libnotify,
maim,
}:
writeShellApplication {
name = "screenshot-screen";
text = ''
set -euo pipefail
umask 077
out="''${XDG_PICTURES_DIR-$HOME/Pictures}/screenshots/$(date +"%Y-%m-%dT%H:%M:%S%:z")-fullscreen.png"
mkdir -p "$(dirname "$out")"
${maim}/bin/maim --hidecursor --format=png --quality=10 --noopengl "$out"
${libnotify}/bin/notify-send \
"📷 Screenshot captured" "💾 Saved to $out" \
|| true
'';
}