It is currently March 28th, 2024, 5:23 pm

New IDLE_TIME SysInfo value

Changes made during the Rainmeter 3.1 beta cycle.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

New IDLE_TIME SysInfo value

Post by jsmorley »

We have added a new SysInfoType of IDLE_TIME to the SysInfo plugin.

This will return the number of seconds since the last user input (mouse or keyboard) to the operating system.

This can be used to have Rainmeter skin take some action (or inaction) based on the fact that the operating system has been "idle" for some number of seconds.

Here is one example of how you might use this information:

Code: Select all

[Rainmeter]
Update=100
AccurateText=1
DynamicWindowSize=1
OnRefreshAction=[!Move 0 0][!ZPos 2][!Hide]

[Metadata]
Name=RainSaver
Author=JSMorley
Information=Rudimentary screen saver for Rainmeter, using new IDLE_TIME data from the SysInfo plugin.||Set IdleSeconds for the idle time you desire.
Version=Feb 25, 2014
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0

[Variables]
IdleSeconds=600
FontSize=120
FontColor=255,255,255,255

[MeasureIdleTime]
Measure=Plugin
Plugin=SysInfo
SysInfoType=Idle_Time
IfAboveValue=#IdleSeconds#
IfAboveAction=[!EnableMeasureGroup "Measures"][!ShowMeterGroup "Meters"][!ToggleFade *]

[MeasureWakeUp]
Measure=Calc
Group=Measures
Formula=MeasureIdleTime
IfEqualValue=0
IfEqualAction=[!ToggleFade *][!Refresh]
Disabled=1

[MeasureTime]
Measure=Time
Group=Measures
Format=%A#CRLF#%B %#d %Y#CRLF#%#I:%M:%S
UpdateDivider=10
Disabled=1

[MeterBackground]
Meter=Image
Group=Meters
W=#SCREENAREAWIDTH#
H=#SCREENAREAHEIGHT#
SolidColor=47,47,47,230
UpdateDivider=-1
Hidden=1

[MeterTime]
Meter=String
Group=Meters
MeasureName=Measuretime
X=(#SCREENAREAWIDTH# / 2)
Y=(#SCREENAREAHEIGHT# / 2)
StringAlign=CenterCenter
FontSize=#FontSize#
FontColor=#FontColor#
AntiAlias=1
Hidden=1
RainSaver_1.0.rmskin
(1.17 KiB) Downloaded 473 times
2014-02-23_121303.jpg
In effect this creates a very rudimentary "Rainmeter screensaver" ;-)

Change IdleSeconds to something smaller to test it without waiting so long...
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: New IDLE_TIME SysInfo value

Post by jsmorley »

Made some changes to the logic of the example skin above to make it work more effeciently. Looking forward to seeing what kind of interesting animations or effects folks can come up with for a Rainmeter screensaver...
Bgdrls
Posts: 66
Joined: April 29th, 2011, 1:03 am

Re: New IDLE_TIME SysInfo value

Post by Bgdrls »

Great idea/job mate, tnx :thumbup:

Is there any trick yo hide mouse cursor when "screensaver" appear?
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: New IDLE_TIME SysInfo value

Post by jsmorley »

Bgdrls wrote:Great idea/job mate, tnx :thumbup:

Is there any trick yo hide mouse cursor when "screensaver" appear?
You could probably create an invisible .cur (cursor) file, and then use Mouse Cursor Actions to change the cursor in Rainmeter.
Bgdrls
Posts: 66
Joined: April 29th, 2011, 1:03 am

Re: New IDLE_TIME SysInfo value

Post by Bgdrls »

Tnx a lot for the tips. I'm gonna try some of this tricks.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: New IDLE_TIME SysInfo value

Post by jsmorley »

NoCursor.zip
(200 Bytes) Downloaded 354 times
If you get this .zip file and unzip the NoCursor.cur file into a folder called @Resources\Cursors\ in the root config folder of your skin, then you can use:

Code: Select all

[MeterBackground]
Meter=Image
Group=Meters
W=#SCREENAREAWIDTH#
H=#SCREENAREAHEIGHT#
SolidColor=47,47,47,230
LeftMouseUpAction=[]
MouseActionCursorName=NoCursor.cur
UpdateDivider=-1
Hidden=1
That will hide the cursor when the "screensaver" skin is toggled on, and set it back to the default cursor when you move the mouse or hit a key to "wake up".

It is simply a completely empty transparent .cur cursor file.
User avatar
moshi
Posts: 1740
Joined: November 13th, 2012, 9:53 pm

Re: New IDLE_TIME SysInfo value

Post by moshi »

jsmorley wrote:You also could probably create an invisible .cur (cursor) file, and then use Mouse Cursor Actions to change the cursor in Rainmeter.
i have attached such a cursor. be careful though, i wouldn't recommend to use it in any other way than with MouseActionCursorName.
IRinvisible.zip
(261 Bytes) Downloaded 336 times
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: New IDLE_TIME SysInfo value

Post by jsmorley »

moshi wrote: i have attached such a cursor. be careful though, i wouldn't recommend to use it in any other way than with MouseActionCursorName.
IRinvisible.zip
Beat you.. ;-)
Bgdrls
Posts: 66
Joined: April 29th, 2011, 1:03 am

Re: New IDLE_TIME SysInfo value

Post by Bgdrls »

@jsmorley this one working like a charm, tnx.

But there is one problem. Screensaver appear also when I watch videos/movies in fullscreen, Youtube videos, etc... Any fix for this issue?
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: New IDLE_TIME SysInfo value

Post by jsmorley »

Bgdrls wrote:@jsmorley this one working like a charm, tnx.

But there is one problem. Screensaver appear also when I watch videos/movies in fullscreen, Youtube videos, etc... Any fix for this issue?
No, I don't know of any way for Rainmeter to detect that a full-screen application is running. Again, there may be some third party addon that could be used to detect a full-screen app and send some "stay alive" keystroke to the system, but I have never had occasion to look into it.

Before this gets too much further, I would say that it is not our intention to try and turn Rainmeter into a full-blown screensaver or power management tool. The skin I posted was just meant to demonstrate one way that you might use the new IDLE_TIME value for SysInfo, and if you really want a fully functional screensaver that takes advantage of all the subtle capabilities available to the .scr screensaver development environment supported in Windows, you might take a look at one of the many tools available to create them.
Post Reply