Re: Snarl
Posted: Mon Jun 30, 2014 11:13 am
Thanks for the improvements.blackwind wrote:... This allows Snarl stock icons to be specified (such as "!system-warning").
The modified code is available in the repository.
Pako
Thanks for the improvements.blackwind wrote:... This allows Snarl stock icons to be specified (such as "!system-warning").
I ended up with the use MediaMonkey a long time ago.EpicCyndaquil wrote:could you share your configuration for the mediamonkey OSD you have in your first post, or any basic configuration involving payloads?
As an example, I'd like to include the artist and title of the currently playing track in a notification whenever a new track starts playing. (I'm using Musicbee with the EventGhost plugin for it, but I'd imagine the process is similar across all music players.) In this post, you mention support for payloads in variables. I assume I would have to do something like that so it knows where to fetch the artist and title from?Pako wrote:I ended up with the use MediaMonkey a long time ago.EpicCyndaquil wrote:could you share your configuration for the mediamonkey OSD you have in your first post, or any basic configuration involving payloads?
With what part of the configuration you do not know what to do ?
Great, I'm also using MusicBee.EpicCyndaquil wrote:I'm using Musicbee
For this purpose, the said function is not necessary.EpicCyndaquil wrote:I assume I would have to do something like that so it knows where to fetch the artist and title from?
I actually believe I have seen that plugin before. However, I mostly wanted to do this with Musicbee as a learning example! Additionally, I may want to display an OSD only when I'm using my speakers and not my headphones, something that EventGhost could easily accomplish.Pako wrote: However, if you want to display MusicBee notification using Snarl, then I suggest another solution.
There is a (brilliant but relatively unknown) Snarl plugin for MusicBee.
It will do a better job (and easier) than indirectly through EventGhost.
That makes sense. But how would I set the content dynamically in a Snarl notification, based on the track? Or, another example to perhaps make this easier - let's say I want to display a notification each time a "Keyboard" event is logged in EventGhost. I want the Snarl notification to display the key(s) pressed (which EventGhost represents as "Keyboard.<key>", like "Keyboard.A". How could I do this?Pako wrote:For this purpose, the said function is not necessary.EpicCyndaquil wrote:I assume I would have to do something like that so it knows where to fetch the artist and title from?
This is necessary for example when you want to dynamically change the content of user menu depending on a variable.
EpicCyndaquil wrote:As an example, I'd like to include the artist and title of the currently playing track in a notification whenever a new track starts playing.
On the attached pictures you can see how it can be solved.EpicCyndaquil wrote:Or, another example to perhaps make this easier - let's say I want to display a notification each time a "Keyboard" event is logged in EventGhost. I want the Snarl notification to display the key(s) pressed (which EventGhost represents as "Keyboard.<key>", like "Keyboard.A". How could I do this?
Code: Select all
<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1669">
<Folder Name="Snarl demo" Expanded="True">
<Macro Name="MusicBee -TrackChanged" Expanded="True">
<Event Name="MusicBee.TrackChanged" />
<Action>
Snarl.Notify(u'MusicBeeTrack', u'{eg.event.payload[1].split("\\n")[0]}', u'{("\\n").join(eg.event.payload[1].split("\\n")[1:])}', u'{eg.plugins.MusicBee.NowPlayingCommand(82, 128, None, None)}', 1, -1, -1, 0, [], u'', [(u'', u''), (u'', u''), (u'', u'')], -1, 0, True, 0)
</Action>
</Macro>
<Macro Name="Keyboard - key pressed" Expanded="True">
<Event Name="Keyboard.*" />
<Action>
Snarl.Notify(u'Keyboard', u'Key pressed', u'{eg.event.suffix}', u'{eg.imagesDir+"\\\\cstatic.png"}', 1, 5, -1, 1, [], u'', [(u'', u''), (u'', u''), (u'', u'')], -1, 1, True, 0)
</Action>
</Macro>
</Folder>
</EventGhost>Instead of "\\n", you want to use "\n". Otherwise, split finds no "\\n" and just assumes you want the entire line.Pako wrote:Code: Select all
Snarl.Notify(u'MusicBeeTrack', u'{eg.event.payload[1].split("\\n")[0]}', u'{("\\n").join(eg.event.payload[1].split("\\n")[1:])}', u'{eg.plugins.MusicBee.NowPlayingCommand(82, 128, None, None)}', 1, -1, -1, 0, [], u'', [(u'', u''), (u'', u''), (u'', u'')], -1, 0, True, 0)
I think you're doing just confusion.EpicCyndaquil wrote:Instead of "\\n", you want to use "\n". Otherwise, split finds no "\\n" and just assumes you want the entire line.
I see no way I could affect it.blackwind wrote:Every time I install a new version of EventGhost, it registers a fresh instance of itself in Snarl, thereby discarding my custom settings. Can we get a fix, Pako?
Code: Select all
self.snarl = pySnarl.SnarlApp(
"EventGhost.%s" % eg.Version.string, # signature
"EventGhost", # title
join(eg.imagesDir, "logo.png"), # icon
"", # configTool
"", # hint
True, # IsDaemon
self.SubEventHandler, # event handler
clss) # classes