diff options
Diffstat (limited to '.local/bin/scst')
-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 |