mirror of
https://github.com/oddlama/nix-config.git
synced 2025-10-10 23:00:39 +02:00
fix: abort screenshot tool if flameshot was cancelled
This commit is contained in:
parent
143f04fb03
commit
5bcf5c8100
2 changed files with 7 additions and 2 deletions
|
@ -22,7 +22,10 @@ writeShellApplication {
|
|||
export QT_SCREEN_SCALE_FACTORS=""
|
||||
|
||||
# Use sponge to create the file on success only
|
||||
${lib.getExe flameshot} gui --raw | ${moreutils}/bin/sponge "$out"
|
||||
if ${lib.getExe flameshot} gui --raw 2>&1 1> >(${moreutils}/bin/sponge "$out") | grep -q "flameshot: info:.*aborted."; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
${xclip}/bin/xclip -selection clipboard -t image/png < "$out"
|
||||
action=$(${libnotify}/bin/notify-send \
|
||||
"📷 Screenshot captured" "📋 copied to clipboard" \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue