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

feat: use flameshot for screenshotting (twice as fast for fullscreen)

This commit is contained in:
oddlama 2023-10-16 02:10:32 +02:00
parent 667fa26f14
commit d081e70d78
No known key found for this signature in database
GPG key ID: 14EFE510775FE39A
5 changed files with 43 additions and 16 deletions

View file

@ -1,7 +1,9 @@
{
lib,
writeShellApplication,
flameshot,
libnotify,
maim,
moreutils,
}:
writeShellApplication {
name = "screenshot-screen";
@ -9,12 +11,14 @@ writeShellApplication {
set -euo pipefail
umask 077
out="''${XDG_PICTURES_DIR-$HOME/Pictures}/screenshots/$(date +"%Y-%m-%dT%H:%M:%S%:z")-fullscreen.png"
date=$(date +"%Y-%m-%dT%H:%M:%S%:z")
out="''${XDG_PICTURES_DIR-$HOME/Pictures}/screenshots/$date-fullscreen.png"
mkdir -p "$(dirname "$out")"
${maim}/bin/maim --hidecursor --format=png --quality=10 --noopengl "$out"
${lib.getExe flameshot} full --raw | ${moreutils}/bin/sponge "$out"
${libnotify}/bin/notify-send \
"📷 Screenshot captured" "💾 Saved to $out" \
--hint="string:wired-tag:screenshot-$date" \
|| true
'';
}