From fd2c508cde1393cbaf4d25abdf9eaebbe5f73895 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Sat, 18 Nov 2023 20:21:50 +0100 Subject: bin/sbin: Use the new ‘notify’ API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .local/bin/scst | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to '.local/bin/scst') 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 -- cgit v1.2.3