gabm / Satty

Satty - Modern Screenshot Annotation. A tool inspired by Swappy and Flameshot.
Mozilla Public License 2.0
486 stars 22 forks source link

[Feature Request] Option to Disable Notification #80

Closed 00-kat closed 2 months ago

00-kat commented 5 months ago

When you copy (or save I think) a screenshot, a notification chimes in: image Could there be an option (maybe --disable-notification) to disable the notification from showing?

Also, may I ask why the notification exists in the first place? Since I feel like it would be incredibly easy to use

satty -f - && notify-send -i /usr/share/icons/hicolor/scalable/apps/satty.svg 'Satty' 'Copied to clipboard.'

when you call it (from maybe a keybind or something) and to maybe even create a satty function that runs notify-send after if you use it from a shell.

gabm commented 4 months ago

before there was a toast inside satty... typically for GUI applications you would want some kind of information about the result of actions... I decided to remove the toast and add the notification especially in case "early-exit" is used - where the app would exit right away after successful action and the toast would not be read...

instead of adding a disable switch, maybe a post-action might also be an option ..?

00-kat commented 4 months ago

before there was a toast inside satty... typically for GUI applications you would want some kind of information about the result of actions... I decided to remove the toast and add the notification especially in case "early-exit" is used - where the app would exit right away after successful action and the toast would not be read...

Ah, that makes a lot of sense.

instead of adding a disable switch, maybe a post-action might also be an option ..?

A post-action sounds cool in theory, but I can't think of how it could ever possibly be implemented. Would it be:

I can't see any use for either of these, and I'm not able to think of any other ways it could be implemented right now. For the first one, almost any operation could be done with the second one (for my examples, notify-send, sh and dex work fine), since shells are quite powerful. For the second one, since satty is run from a shell, and since it already prints out the information (e.g. 'Copied to clipboard.') to stdout, pipes or command substitution would be a really simple way to do it, for example:

That notification

notify-send -i /usr/share/icons/hicolor/scalable/apps/satty.svg 'Satty' "$(grim - | satty -f -)"

Maybe you fancy dialog boxes

zenity --info --title Satty --icon satty --text "$(grim - | satty -f -)"

Automatically paste if copied (DON'T RUN IN A TERMINAL SINCE IT WILL PASTE BINARY DATA INTO YOUR TERMINAL, CRASHING IT)

if [ "$(grim - | satty -f -)" = 'Copied to clipboard.' ]; then wl-paste; fi

Open in gimp to edit (best used with autosave on copy option enabled)

grim - | satty -f - | awk -F "'" '{ print $2 }' | xargs -d'\n' gimp
danielwerg commented 2 months ago

Would love to see --disable-notifications flag and disable-notifications setting!

gabm commented 2 months ago

go ahead :)