From 4faa34938169a5d116c8cd75335f0a5a125f2eaa Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Tue, 7 Nov 2023 21:09:38 +0100 Subject: scst: Notify on file save --- .local/bin/scst | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to '.local/bin/scst') diff --git a/.local/bin/scst b/.local/bin/scst index 43ba261..d1ad54a 100755 --- a/.local/bin/scst +++ b/.local/bin/scst @@ -22,7 +22,8 @@ then fi readonly outdir=${XDG_PICTURES_DIR:-$HOME/Pictures}/screen -readonly filename="$outdir/`date +%F_%T.png`" +readonly filebase=$(date +%F_%T.png) +readonly filename="$outdir/$filebase" [ -d "$outdir" ] || mkdir -p "$outdir" if ${fflag:-false} @@ -34,7 +35,10 @@ fi [ -f "$filename" ] || exit 1 -opt="`printf 'Copy screenshot\nEdit- and copy screenshot\n' | osel`" +opt="$( + printf 'Copy screenshot\nEdit- and copy screenshot\n' \ + | { osel || true; } +)" case "$opt" in 'Copy screenshot') @@ -47,4 +51,8 @@ case "$opt" in | sponge "$filename" xnotify ;; +*) + notify ${0##*/} screenshot 'Screenshot Saved' \ + "The screenshot ‘$filebase’ was successfully saved" \ + -i "$filename" esac -- cgit v1.2.3