diff options
author | Thomas Voss <mail@thomasvoss.com> | 2023-11-18 20:21:50 +0100 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2023-11-18 20:21:50 +0100 |
commit | fd2c508cde1393cbaf4d25abdf9eaebbe5f73895 (patch) | |
tree | dbb46663dc495da2ffdd5d7da66c2b6c38de5eb4 /.local/bin/scst | |
parent | f8f144c9810fd6f16f843de4297cc20498a11291 (diff) |
bin/sbin: Use the new ‘notify’ API
Diffstat (limited to '.local/bin/scst')
-rwxr-xr-x | .local/bin/scst | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/.local/bin/scst b/.local/bin/scst index d1ad54a..51b00c1 100755 --- a/.local/bin/scst +++ b/.local/bin/scst @@ -2,9 +2,12 @@ set -e +export NOTIFY_LONG=screenshot +export NOTIFY_SHORT="${0##*/}" + xnotify() { - notify ${0##*/} screenshot 'Screenshot Copied' \ + notify 'Screenshot Copied' \ 'Screenshot successfully copied to the clipboard' \ -i "$filename" } @@ -35,10 +38,7 @@ fi [ -f "$filename" ] || exit 1 -opt="$( - printf 'Copy screenshot\nEdit- and copy screenshot\n' \ - | { osel || true; } -)" +opt="$(printf 'Copy screenshot\nEdit- and copy screenshot\n' | { osel || true; })" case "$opt" in 'Copy screenshot') @@ -46,13 +46,11 @@ case "$opt" in xnotify ;; 'Edit- and copy screenshot') - swappy -f "$filename" -o - \ - | pee wl-copy cat \ - | sponge "$filename" + swappy -f "$filename" -o - | pee wl-copy cat | sponge "$filename" xnotify ;; *) - notify ${0##*/} screenshot 'Screenshot Saved' \ + notify 'Screenshot Saved' \ "The screenshot ‘$filebase’ was successfully saved" \ -i "$filename" esac |