flameshot-org / flameshot

Powerful yet simple to use screenshot software :desktop_computer: :camera_flash:
https://flameshot.org
GNU General Public License v3.0
24.8k stars 1.59k forks source link

Make notifications transient #388

Open ghost opened 5 years ago

ghost commented 5 years ago

As things stand, notifications from flameshot - e.g. 'capture saved to clipboard' (or some such) - are permanent, in the following sense. They persist - not as pop-ups, but in the list shown in my notifications applet - until I dismiss them.

I'd prefer so-called 'transient' notifications, which is to say, ones that disappear entirely once they no longer obtrude on the screen. One can generate such transient notifications thusly:

notify-send --hint=int:transient:1 $TEST

Or perhaps - though this might be overkill, and would be a bit of hassle to implement, I imagine - the user could be given a choice between the two types of notification.

lupoDharkael commented 5 years ago

Flameshot relies on libnotify for sending notifications. I didn't know about that hint and it seems to be supported by the Notification specification https://developer.gnome.org/notification-spec/#hints

hosiet commented 5 years ago

https://github.com/lupoDharkael/flameshot/blob/ee2f583acd425a9f35187c4eb17cbf1b993b4f36/src/utils/systemnotification.cpp#L31-L38

@lupoDharkael We already have timeout implemented... it's just we need to enable it in all codes that calls sendMessage().

hosiet commented 5 years ago

Some invocation to systemNotification::sendMessage() should indeed be transient (e.g., notification o fsuccessful screen capture) but some may not. That might need to be decided on a case-by-case basis.

hosiet commented 5 years ago

Okay I took a deeper look and seems that hint is different from timeout... Current flameshot code indeed doesn't support it yet and we may implement it as enhancement.

ghost commented 5 years ago

It may be worth noting that Cinnamon (1) does not honour any timeout setting, (2) does honour the 'transience' setting. I read somewhat that 1 is true of other desktop environments too.

hosiet commented 5 years ago

That's interesting. I'm a GNOME Shell & KDE Plasma user and timeout are both honoured. Cinnamon should be a fork of GNOME Shell and I'm surprised that it doesn't support timeout...

ghost commented 5 years ago

Well, Cinnamon was forked a long time ago; and I know from my system that setting a timeout - at least via the /usr/bin/notify-send - does not affect the persistence of tooltips on my PC (thought it doesn't throw an error or warning). Indeed I think there is something in Cinnamon's documentation about that lack of honouring (but I don't know where in the documentation, I'm afraid).