From 4c093e2886f26174f3a6d69b43ecddd4e1d4de91 Mon Sep 17 00:00:00 2001 From: cswimr Date: Fri, 11 Oct 2024 23:39:44 -0400 Subject: [PATCH] trap before executing flameshot or spectacle --- .zshc/func.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.zshc/func.zsh b/.zshc/func.zsh index 1b64883..045e463 100644 --- a/.zshc/func.zsh +++ b/.zshc/func.zsh @@ -117,6 +117,7 @@ function spectacle-screenshot { else readonly file=$2 fi + trap 'rm -f "$file"' EXIT if $save_recording; then command spectacle --nonotify --background --record=region --copy-image --output "$file" @@ -125,7 +126,6 @@ function spectacle-screenshot { fi [ ! -s "$file" ] && return 1 - trap 'rm -f "$file"' EXIT zipline "$file" Spectacle org.kde.spectacle.desktop } @@ -147,12 +147,12 @@ function flameshot-screenshot { else readonly file=$1 fi + trap 'rm -f "$file"' EXIT command flameshot gui --clipboard --raw > $file echo "Screenshot saved to $file" [ ! -s "$file" ] && return 1 - trap 'rm -f "$file"' EXIT zipline "$file" Flameshot org.flameshot.Flameshot.desktop }