diff options
author | Thomas Voss <mail@thomasvoss.com> | 2023-11-07 21:09:38 +0100 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2023-11-07 21:09:38 +0100 |
commit | 4faa34938169a5d116c8cd75335f0a5a125f2eaa (patch) | |
tree | ac4f3655e4c2de2531d64e053297c4db540138a9 /.local | |
parent | 9a78e1a82e86648ca088ad8430d3120e8cd7f5aa (diff) |
scst: Notify on file save
Diffstat (limited to '.local')
-rwxr-xr-x | .local/bin/scst | 12 |
1 files changed, 10 insertions, 2 deletions
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 |