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:
parent
3e0e03fc31
commit
6e8aae7d8d
15 changed files with 216 additions and 109 deletions
20
pkgs/scripts/screenshot-screen.nix
Normal file
20
pkgs/scripts/screenshot-screen.nix
Normal 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
|
||||
'';
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue