cswimr/home
Archived
Template
1
0
Fork 0

trap before executing flameshot or spectacle

This commit is contained in:
Seaswimmer 2024-10-11 23:39:44 -04:00
parent 2a84867059
commit 4c093e2886
Signed by: cswimr
GPG key ID: A9C162E867C851FA

View file

@ -117,6 +117,7 @@ function spectacle-screenshot {
else else
readonly file=$2 readonly file=$2
fi fi
trap 'rm -f "$file"' EXIT
if $save_recording; then if $save_recording; then
command spectacle --nonotify --background --record=region --copy-image --output "$file" command spectacle --nonotify --background --record=region --copy-image --output "$file"
@ -125,7 +126,6 @@ function spectacle-screenshot {
fi fi
[ ! -s "$file" ] && return 1 [ ! -s "$file" ] && return 1
trap 'rm -f "$file"' EXIT
zipline "$file" Spectacle org.kde.spectacle.desktop zipline "$file" Spectacle org.kde.spectacle.desktop
} }
@ -147,12 +147,12 @@ function flameshot-screenshot {
else else
readonly file=$1 readonly file=$1
fi fi
trap 'rm -f "$file"' EXIT
command flameshot gui --clipboard --raw > $file command flameshot gui --clipboard --raw > $file
echo "Screenshot saved to $file" echo "Screenshot saved to $file"
[ ! -s "$file" ] && return 1 [ ! -s "$file" ] && return 1
trap 'rm -f "$file"' EXIT
zipline "$file" Flameshot org.flameshot.Flameshot.desktop zipline "$file" Flameshot org.flameshot.Flameshot.desktop
} }