It is currently November 15th, 2019, 3:54 am

using Rainmeter with Snarl

Tips and Tricks from the Rainmeter Community
User avatar
moshi
Posts: 1851
Joined: November 13th, 2012, 9:53 pm

using Rainmeter with Snarl

moshi » July 6th, 2013, 11:21 am

do you know Snarl? http://snarl.fullphat.net/

maybe you should. it displays notifications on your desktop and does a lot of things that would be either hard to do or just impossible with Rainmeter right now.
it comes with quite a few styles and one could even learn how to code (yes, code) your own. but wouldn't it be nicer to just use the data with Rainmeter?

Snarl supports "redirects", so it can pass it's data to other applications (not only applications btw.) as command line arguments, so how could we use these with Rainmeter?

let's write a BAT file, it could look like this:

Code: Select all

"c:\program files\rainmeter\rainmeter.exe" !WriteKeyValue Variables "NotificationsText1" %1 "C:%HOMEPATH%\Documents\Rainmeter\Skins\RainSnarl\@RESOURCES\Includes\notifications.inc"
"c:\program files\rainmeter\rainmeter.exe" !WriteKeyValue Variables "NotificationsText2" %2 "C:%HOMEPATH%\Documents\Rainmeter\Skins\RainSnarl\@RESOURCES\Includes\notifications.inc"
"c:\program files\rainmeter\rainmeter.exe" !WriteKeyValue Variables "NotificationsText3" %3 "C:%HOMEPATH%\Documents\Rainmeter\Skins\RainSnarl\@RESOURCES\Includes\notifications.inc"
"c:\program files\rainmeter\rainmeter.exe" !Refresh RainSnarl
"c:\program files\rainmeter\rainmeter.exe" !ActivateConfig RainSnarl
did you notice %1, %2 etc.? these are the command line arguments that can be passed to a batch file (up to 9, starts from 1).

we already could use this, but then there would be an ugly cmd window popping up. so lets write a VBS file as well. it could look like this:

Code: Select all

Set WshShell = CreateObject("WScript.Shell") 
WshShell.Run """C:%HOMEPATH%\Documents\Rainmeter\Skins\RainSnarl\@RESOURCES\Addons\notification.bat"" """ & WScript.Arguments.Item(0) & """  """ & WScript.Arguments.Item(1) & """  """ & WScript.Arguments.Item(2) & """", 0
Set WshShell = Nothing
did you notice """ & WScript.Arguments.Item(0) & """? these are the command line arguments that can be passed to a Windows Scripting Host file (starts from 0), they will be passed to the batch file.

now we need to configure Snarl to use this VBS file. i am not going to write down every step here. these two screenshots should be enough to figure it out:
RainSnarl1.jpg
RainSnarl2.jpg
i have attached an example skin. it slides in, displays a message, slides out and exits. so pretty much the same that Snarl does anyways.;)
but using the method described above you can do pretty much everything with the data in Rainmeter, and hey, you're not limited to Snarl, you can remote control Rainmeter from start menu entries, third-party apps, etc.
You do not have the required permissions to view the files attached to this post.