It is currently November 14th, 2019, 7:50 am

New IDLE_TIME SysInfo value

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

New IDLE_TIME SysInfo value

jsmorley » February 23rd, 2014, 6:45 pm

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
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...
You do not have the required permissions to view the files attached to this post.
User avatar
jsmorley
Developer
Posts: 19706
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: New IDLE_TIME SysInfo value

jsmorley » February 25th, 2014, 12:43 pm

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: 65
Joined: April 29th, 2011, 1:03 am

Re: New IDLE_TIME SysInfo value

Bgdrls » February 26th, 2014, 7:59 am

Great idea/job mate, tnx :thumbup:

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

Re: New IDLE_TIME SysInfo value

jsmorley » February 26th, 2014, 12:24 pm

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: 65
Joined: April 29th, 2011, 1:03 am

Re: New IDLE_TIME SysInfo value

Bgdrls » February 26th, 2014, 3:16 pm

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

Re: New IDLE_TIME SysInfo value

jsmorley » February 26th, 2014, 3:37 pm

NoCursor.zip
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.
You do not have the required permissions to view the files attached to this post.
User avatar
moshi
Posts: 1851
Joined: November 13th, 2012, 9:53 pm

Re: New IDLE_TIME SysInfo value

moshi » February 26th, 2014, 3:37 pm

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
You do not have the required permissions to view the files attached to this post.
User avatar
jsmorley
Developer
Posts: 19706
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: New IDLE_TIME SysInfo value

jsmorley » February 26th, 2014, 3:38 pm

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: 65
Joined: April 29th, 2011, 1:03 am

Re: New IDLE_TIME SysInfo value

Bgdrls » February 27th, 2014, 6:59 am

@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: 19706
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: New IDLE_TIME SysInfo value

jsmorley » February 27th, 2014, 2:42 pm

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.