It is currently April 27th, 2024, 3:39 pm

Looking for some hints.

Get help with creating, editing & fixing problems with skins
User avatar
MerlinTheRed
Rainmeter Sage
Posts: 889
Joined: September 6th, 2011, 6:34 am

Re: Looking for some hints.

Post by MerlinTheRed »

That's because it's not obvious how to do it ;)
There is no built-in action that is run every update cycle, so you have to make it so that some ifAbove/Equal/BelowAction is triggered every update cycle:

Code: Select all

[MeasureCycle]
Measure=Calc
Formula=MeasureCalc%2
IfAboveValue=0
IfAboveAction=[your action here]
IfBelowValue=1
IfBelowAction=[same action here]
Have more fun creating skins with Sublime Text 2 and the Rainmeter Package!
User avatar
Kaelri
Developer
Posts: 1721
Joined: July 25th, 2009, 4:47 am

Re: Looking for some hints.

Post by Kaelri »

You could also do it with a simple Lua script, which, while less clever, is also less offensive to one's programming sensibilities. :)

Code: Select all

[MeasureCycle]
Measure=Script
ScriptFile=Cycle.lua

Code: Select all

function Update() SKIN:Bang('[your action here]') end
Citrus
Posts: 14
Joined: November 8th, 2012, 3:27 am

Re: Looking for some hints.

Post by Citrus »

MerlinTheRed wrote:Would you mind sharing what console command you use to crawl you file system for vcs repos? I didn't know this was possible.
Here's what I have so far in Powershell:

Code: Select all

$projects = Get-ChildItem -Path "C:\Users\MyName\developer\Projects" -Recurse -Force -ea SilentlyContinue | where {$_.PsIsContainer -and ($_.name -eq ".git" -or $_.name -eq ".hg")};
$projects | ForEach-Object -process {
    if ($_.name -eq ".git") {
        '[Git] ' + $_.parent.name.ToUpper(); Invoke-Expression ('git --git-dir="' + $_.fullname + '"' + ' --work-tree="' + $_.parent.fullname + '" status'); "`n"
    } else {
        '[Hg ] ' + $_.parent.name.ToUpper(); Invoke-Expression ('hg status -R "' + $_.parent.fullname + '"' ); Invoke-Expression ('hg out -R "'  + $_.parent.fullname + '"' ); "`n"
    }
} | Out-File ($env:temp + '\repo.txt')
You have to set your Powershell execution policy to "RemoteSigned" or "Unrestricted" (I'd choose the former), and set the path in the first line to be where you keep your repos. You can make the path "C:\" to crawl your whole drive, but that takes a while. The file ends up in your temp directory.

Like a lot of scripting languages, this will pop up a console window when you run it. So, the best way around it is to execute it from a VBS with "powershell -file ScriptName.ps1" and making the window hidden. I'm still working on the part where Rainmeter runs it and displays it, but I think this answers your question. Note that this only looks for Mercurial or Git repos. If you're using some other vcs... switch to Mercurial or Git. :)
User avatar
MerlinTheRed
Rainmeter Sage
Posts: 889
Joined: September 6th, 2011, 6:34 am

Re: Looking for some hints.

Post by MerlinTheRed »

I just asked because I thought there was some built-in command somewhere that does this. Thanks anyway for sharing your code :)
Have more fun creating skins with Sublime Text 2 and the Rainmeter Package!
Citrus
Posts: 14
Joined: November 8th, 2012, 3:27 am

Re: Looking for some hints.

Post by Citrus »

So, I managed to figure all this stuff out for my repo skin. I posted about it here, if you want a copy: http://rainmeter.net/forum/viewtopic.php?f=27&t=14502