Page 1 of 2

TrayTip plugin - v0.2.0

Posted: Tue Aug 22, 2017 3:04 am
by Boolean263
Version 0.2.0 released! Highlights:
  • The API has changed! Again! ShowTip()'s function signature is different. You'll probably have to delete and recreate your actions (again).
  • Specify an event suffix for TrayTip events. No more needing to check {eg.event.payload}! (You can still pass a payload if you want, though.)
  • (0.1.x) Choose an icon for your notification, or choose no icon at all.
  • (0.1.x) Optionally disable the default notification sound.
  • See the changelog for more details.
~*~*~

Me again! I just can't seem to help myself.

TrayTip is an action plugin for popping up notifications in the Windows system tray. You can specify the title and detail message to show in the notification, along with what icon to show, and whether it should play a sound.

If you click on the notification, it'll generate a TrayTip.Clicked event in EventGhost for you to act on. When you configure the action, you can also specify an event suffix to be included in the Clicked event; you'll need to do this if you want different messages to do different things when they're clicked on.

The title, message, event suffix, and payload fields are all interpreted for python code in {curly braces}.

You can pop up a notification from your own python script actions by calling eg.plugins.TrayTip.ShowTip(title, msg, event_name, payload, iconOpt, sound) directly.

Source code and full documentation: Boolean263/EventGhost-TrayTip on gitlab

Releases: will be attached to this forum post.

Re: TrayTip plugin - v0.0.1

Posted: Tue Aug 22, 2017 8:04 am
by Luca Brasi
Great man, keep them coming! :D
Just set up a notification on my laptop when my htpc is about to go to sleep. If I click the notification the sleep will be interrupted. If I hit the X the sleep will proceed.
Thanks!

Re: TrayTip plugin - v0.0.1

Posted: Tue Aug 22, 2017 2:36 pm
by Boolean263
Luca Brasi wrote:Great man, keep them coming! :D
Just set up a notification on my laptop when my htpc is about to go to sleep. If I click the notification the sleep will be interrupted. If I hit the X the sleep will proceed.
Thanks!
That's awesome! I'm glad you're finding it so useful. That's a neat idea!

Re: TrayTip plugin - v0.0.1

Posted: Tue Aug 22, 2017 2:40 pm
by Boolean263
Huge thanks also to @kgschlosser, who's already submitted four pull requests against my code, and in the process, is teaching me more about wxPython and about EventGhost's coding standards!

Re: TrayTip plugin - v0.0.1

Posted: Mon Aug 28, 2017 2:12 am
by kgschlosser
@ Luca Brasi

do me a favor. make up a nice little tutorial for doing that with some screen shots and post itin the tutorials section.

Re: TrayTip plugin - v0.0.1

Posted: Tue Aug 29, 2017 10:17 am
by Luca Brasi
kgschlosser wrote:@ Luca Brasi

do me a favor. make up a nice little tutorial for doing that with some screen shots and post itin the tutorials section.
Sure, will do as soon as I find some spare time...

Re: TrayTip plugin - v0.1.0

Posted: Sat Sep 02, 2017 3:51 pm
by Boolean263
v0.1.0 released! See the first post for the download and highlights. Enjoy!

Re: TrayTip plugin - v0.1.0

Posted: Sun Sep 03, 2017 1:31 pm
by Neytrino-OnLine
Very coolplugin, but I have found several bugs:
ÔÇó If I have chosen *.ico-file for costum icon
Image
The notification is shown with a standard app icon...
Image
If the icon is chosen from library - it is displayed correctly...
ÔÇó If I open Icon choice window,
Image
And without having made a choice - I will press Ok (in notices settings window),
Image
It crushes EG...

Also: I think it would be very useful, to have control which would allow to a notification - stay in the notification center (while it will be seen by user), and maybe it is possible: not only system notices (Like updates for example) can use buttons.? (It could be very powerful way of interaction with the user)

Re: TrayTip plugin - v0.1.0

Posted: Sun Sep 03, 2017 3:03 pm
by Boolean263
Neytrino-OnLine wrote:Very coolplugin, but I have found several bugs:
ÔÇó If I have chosen *.ico-file for costum icon
Image
The notification is shown with a standard app icon...
Image
If the icon is chosen from library - it is displayed correctly...
The standard app icon is shown as a fallback when something goes wrong with loading the icon. I've tested with icons from .EXE and .DLL files, but not from .ICO files, so I probably honked something up there. I'll look into it.
Neytrino-OnLine wrote: ÔÇó If I open Icon choice window,
Image
And without having made a choice - I will press Ok (in notices settings window),
Image
It crushes EG...
Please don't do that. (: Seriously, I'll see what I can do to prevent this, but I don't know that it's possible.
Neytrino-OnLine wrote: Also: I think it would be very useful, to have control which would allow to a notification - stay in the notification center (while it will be seen by user), and maybe it is possible: not only system notices (Like updates for example) can use buttons.? (It could be very powerful way of interaction with the user)
I haven't found a way to make the notification persist in the notification center yet, nor a way of adding buttons to a notification. If you find examples of how to do that, it'd be a great help!

Thanks for your feedback!

Re: TrayTip plugin - v0.1.1

Posted: Sun Sep 03, 2017 3:51 pm
by Boolean263
Verson 0.1.1 is released! Download is in the first post. This release fixes both issues that Neytrino-OnLine reported: .ICO files now load properly, and the configuration dialog gets hidden while you're choosing an icon (so you can't close the configuration dialog and crash EventGhost).

Re: TrayTip plugin - v0.1.1

Posted: Sun Sep 03, 2017 4:05 pm
by Neytrino-OnLine
I confirm, Thanks!

Re: TrayTip plugin - v0.1.2

Posted: Sun Sep 03, 2017 7:27 pm
by Boolean263
I'm glad to hear it! Thanks for finding those bugs!

Version 0.1.2 adds a patch from topic2k (thanks!) that allows you to use path variables (like %SystemPath%) in the path to the icon. It's attached to the first post of this thread.

Re: TrayTip plugin - v0.1.2

Posted: Mon Sep 04, 2017 5:32 pm
by Neytrino-OnLine
Hi, one more problem:
So, I make a sleep timer and I want to get notifications each 10 minutes that the PC will be switch off in XX min's... Also, if I click one of these notices - the timer should be stopped. I have set: Event payload = Sleep Timer,
Image
And if I click the notice - it is displayed in llog as event: TrayTip.Clicked u"Sleep Timer",
Image
But if I drag this event in a macro, it loses the identifier in a name - so the click according to any similar notice - will stop the timer...
Image

Re: TrayTip plugin - v0.1.2

Posted: Mon Sep 04, 2017 7:40 pm
by topix
Thats because "Sleeptimer" is just a payload to the event "TrayTip.Clicked". You need to use a PythonScript to evaluate the payload and then do things if the right value was found.

Code: Select all

if eg.event.payload == "Sleeptimer":
I've made a pull request with changes to select between event suffix and event payload. If the pull request gets accepted, you won't need above scripting. (let's cross fingers :wink: )

Re: TrayTip plugin - v0.2.0

Posted: Tue Sep 05, 2017 12:50 pm
by Boolean263
Thank you for your code contribution! I like the event suffix idea. I still like the payload, though, so I figured, why not both?

Version 0.2.0 of TrayTip is out, and attached to the top post of this thread. It leverages topic's changes to add a separate field for naming the events generated by TrayTip.

This changes the function signature for ShowTip(), so you'll probably have to delete and recreate your TrayTip actions (again). Hopefully it'll be worth it!