It is currently April 27th, 2024, 8:11 pm

Looking for some hints.

Get help with creating, editing & fixing problems with skins
Citrus
Posts: 14
Joined: November 8th, 2012, 3:27 am

Looking for some hints.

Post by Citrus »

Hi!

I'm a total noob with Rainmeter (but an experienced programmer otherwise), and I'm trying to put some skins together. Some of the things I want to do, I haven't seen a good similar example of. Here are my curveballs, I hope that they're possible - and interesting:

1. I want to create something like the RSS readers out there. They're pretty cut and dry, but for the meters, I want to have both a graphical bullet and a string for each item. Is there an easy way to do that, that I'm just missing? The documentation implies that meters must be either Image or String type, and you can't do both. Can you? If not, is there a good way to "fake it", maybe having two meters next to each other or something?

2. Also, for the above meter, I'd like to have the style of each RSS item have a possible different color, based on what they contain. Picture an RSS feed with different news sections for every story (Sports in blue, Entertainment in green, etc.) I'd also like to do this with my Google calendar feed - a different color for each entry, based on what named calendar it's in. Is this possible? It looks like I could do it with a dynamic variable, but the documentation says that the WebParser plugin can't use them. Although, I imagine that the meters they feed can? A super-simple example would be a huge boost for me here. No meter I've seen on DA or Customize has done this.

3. I'd like a meter that crawls my filesystem looking for Mercurial or Git repos, and reports on their current status. Normally, I'd find this information out by running a console command. Is there a way to run a console command, read what it says, and use that text in a meter? Would I have to write this into a Lua script? I'm also thinking that I need to script the directory crawl, but I imagine there has to be a measure out there already that does a filesystem search for something.

Thanks for listening! I hope I can get a few hints to speed my way.
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Looking for some hints.

Post by jsmorley »

Citrus wrote:Hi!

I'm a total noob with Rainmeter (but an experienced programmer otherwise), and I'm trying to put some skins together. Some of the things I want to do, I haven't seen a good similar example of. Here are my curveballs, I hope that they're possible - and interesting:

1. I want to create something like the RSS readers out there. They're pretty cut and dry, but for the meters, I want to have both a graphical bullet and a string for each item. Is there an easy way to do that, that I'm just missing? The documentation implies that meters must be either Image or String type, and you can't do both. Can you? If not, is there a good way to "fake it", maybe having two meters next to each other or something?

2. Also, for the above meter, I'd like to have the style of each RSS item have a possible different color, based on what they contain. Picture an RSS feed with different news sections for every story (Sports in blue, Entertainment in green, etc.) I'd also like to do this with my Google calendar feed - a different color for each entry, based on what named calendar it's in. Is this possible? It looks like I could do it with a dynamic variable, but the documentation says that the WebParser plugin can't use them. Although, I imagine that the meters they feed can? A super-simple example would be a huge boost for me here. No meter I've seen on DA or Customize has done this.

3. I'd like a meter that crawls my filesystem looking for Mercurial or Git repos, and reports on their current status. Normally, I'd find this information out by running a console command. Is there a way to run a console command, read what it says, and use that text in a meter? Would I have to write this into a Lua script? I'm also thinking that I need to script the directory crawl, but I imagine there has to be a measure out there already that does a filesystem search for something.

Thanks for listening! I hope I can get a few hints to speed my way.
1) This one at least is easy. You just have to have two meters, one for the image and one for the string. The key is that meters can be positioned "relative" to each other, using the "R" or "r" posfix on the position options of X and Y. http://docs.rainmeter.net/manual/meters/general-options#XY

2) This will take some Lua to do. I would just have a loop in Lua that looks at each child measure returning a value (or you can just parse the whole thing in Lua, which might be better really, but a bit more complicated.) and sets the FontColor or other style attributes for the corresponding meter using !SetOption bangs from the Lua.

3) This you can probably do in Rainmeter without Lua, but you are going to need some console application that you execute on some timed basis from the skin (best if you can use a compiled language like C++ or AutoIt, or perhaps a VBS script, as you don't want a cmd window to pop up.). This external app would check the status of the git repos and create some kind of text file (some XML'ish format is easy to parse) that you would then parse using WebParser in Rainmeter.
Citrus
Posts: 14
Joined: November 8th, 2012, 3:27 am

Re: Looking for some hints.

Post by Citrus »

Thank you! Now, to give these things a go, and see if I can get anywhere.
User avatar
MerlinTheRed
Rainmeter Sage
Posts: 889
Joined: September 6th, 2011, 6:34 am

Re: Looking for some hints.

Post by MerlinTheRed »

Would you mind sharing what console command you use to crawl you file system for vcs repos? I didn't know this was possible.
Have more fun creating skins with Sublime Text 2 and the Rainmeter Package!
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Looking for some hints.

Post by jsmorley »

Citrus wrote:Thank you! Now, to give these things a go, and see if I can get anywhere.
Feel free to ask questions if you get stuck somewhere.
Citrus
Posts: 14
Joined: November 8th, 2012, 3:27 am

Re: Looking for some hints.

Post by Citrus »

I'm waffling between using a win32 build of find, using a batch file or powershell script, and writing it in Lua. I'm still evaluating the pros and cons. Once I finish, I'll definitely share what I come up with.
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Looking for some hints.

Post by jsmorley »

Citrus wrote:I'm waffling between using a win32 build of find, using a batch file or powershell script, and writing it in Lua. I'm still evaluating the pros and cons. Once I finish, I'll definitely share what I come up with.
Just be aware that Lua is both pretty limited in what it can do in the file system (since it is platform agnostic) and any "os" calls will pop a cmd window while executing. My view is that you are better off writing something that won't raise a DOS window, and execute it from Rainmeter. Then just have Lua read and parse the resulting file.
Citrus
Posts: 14
Joined: November 8th, 2012, 3:27 am

Re: Looking for some hints.

Post by Citrus »

Poking around a bit, it looks like it's really hard to run anything in the shell without popping up a console window.

My original inclination was to write a Ruby script to do it, and run it with rubyw.exe . The problem with that is that it makes it a pain to share. Most people aren't going to have Ruby installed on windows, and it's an extra step.

Powershell can get the job done, but it generally creates a window, even if you call it as "hidden".

VBS is simple, but it blows up if you hit any characters that are outside basic ASCII or in another code page. So, I can't do it strictly that way. But, it seems that I can trigger a VBS to run a powershell script silently. That's a bit of a Rube Goldberg machine for my taste.

And, of course, as mentioned, Lua can't run anything on the shell without opening a window.

Still looking...
User avatar
fragrant.monkey
Posts: 51
Joined: September 18th, 2010, 1:03 am

Re: Looking for some hints.

Post by fragrant.monkey »

If you are interested in using plain old batch scripting...

I have used a utility before to 'compile' bat files into an exe. One of the options is to have the exe/script run 'hidden'.

Be warned that it does also use UPX compression, and this can possibly lead to false positive virus reports... at least it did for me in the past.

Look for 'Bat To Exe Converter' at:
http://www.f2ko.de/
fragrant.monkey :: deviantArt: aka snuffleupagus | coding: ThemeSaver for RocketDock | musician: Madera Dulce
Citrus
Posts: 14
Joined: November 8th, 2012, 3:27 am

Re: Looking for some hints.

Post by Citrus »

OK, silly question time. How do you get a measure to run an executable whenever it does an update? (I'm leaning toward the VBS now.) Strangely, the documentation doesn't make this obvious anywhere.

Thanks!