summaryrefslogtreecommitdiff
path: root/.local/bin/scst
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2023-11-18 20:21:50 +0100
committerThomas Voss <mail@thomasvoss.com> 2023-11-18 20:21:50 +0100
commitfd2c508cde1393cbaf4d25abdf9eaebbe5f73895 (patch)
treedbb46663dc495da2ffdd5d7da66c2b6c38de5eb4 /.local/bin/scst
parentf8f144c9810fd6f16f843de4297cc20498a11291 (diff)
bin/sbin: Use the new ‘notify’ API
Diffstat (limited to '.local/bin/scst')
-rwxr-xr-x.local/bin/scst16
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