Code: Select all
[Rainmeter]
Update=1000
OnRefreshAction=[!KeepOnScreen 1][!SnapEdges 1][!SetVariable lx "(#CURRENTCONFIGX# + 0)"][!SetVariable ly "(#CURRENTCONFIGY# + 0)"][!SetVariable zx #lx#][!SetVariable zy #ly#]
[Metadata]
Name=Dark
Author=zingeo, balala, eclectic-tech
Information=draggable hot spot/strip to toggle fading fulldesktop cover,
; varying dark color, then a mouse action anywhere to reset.
Version=1.1
[Variables]
; visibility toggle flag, 1 = desktop is visible
visible=1
; main screen size, one main monitor
sw=#SCREENAREAWIDTH#
sh=#SCREENAREAHEIGHT#
; virtual/entire desktop size, all monitors
vw=#VSCREENAREAWIDTH#
vh=#VSCREENAREAHEIGHT#
; actuator shape initial parms; adjust for spot or stripe
aw=5
ah=#SCREENAREAHEIGHT#
; current/next shape parms
cw=#aw#
ch=#ah#
; max color intensity (colorscale = highest r/g/b value) --- BRIGHTNESS 0-255
colorscale=24
colorscaleh=(#colorscale# / 2)
; 1000 / Update timer :
timescale=1
; initial random #, different start color every run-------------
[rnd]
Measure=Calc
DynamicVariables=1
Formula=([rnd] = 0 ? Random * 1234 : [rnd])
; main clock-----------------------------
[tick0]
Measure=Calc
DynamicVariables=1
formula=(tick0 + 1)
; main clock + random--------------------
[tick]
Measure=Calc
DynamicVariables=1
formula=(tick0 + rnd)
; red-------------------------------------------------------------------------
[mzR]
Measure=Calc
DynamicVariables=1
Formula=floor(sin([tick] / (13 * #timescale#)) * #colorscaleh# + #colorscaleh#)
; green-----------------------------------------------------------------------
[mzG]
Measure=Calc
DynamicVariables=1
Formula=floor(sin([tick] / (19 * #timescale#)) * #colorscaleh# + #colorscaleh#)
; blue------------------------------------------------------------------------
[mzB]
Measure=Calc
DynamicVariables=1
Formula=floor(sin([tick] / (17 * #timescale#)) * #colorscaleh# + #colorscaleh#)
; x/y origin control-----------------------------------------------------------------------------------------------------------------
[mzOrigxy]
Measure=Calc
DynamicVariables=1
Formula=1
IfCondition=(#visible# = 1)
IfTrueAction =[!ShowFade][!SetVariable cw #aw#][!SetVariable ch #ah#][!UpdateMeter *][!Redraw][!Move #zx# #zy#]
IfFalseAction=[!Hide][!SetVariable cw #vw#][!SetVariable ch #vh#][!UpdateMeter *][!ShowFade][!Redraw][!Move 0 0 ]
; meter: actuator spot/strip, or whole desktop shape---------------------------------------------------------------------------------------------
[mtSS]
Meter=Shape
DynamicVariables=1
Shape=Rectangle 0,0,#cw#,#ch# | Fill color ([mzR]),([mzG]),([mzB]),255
LeftMouseUpAction=[!SetVariable visible "(1 - #visible#)"][!SetVariable zx #lx#][!SetVariable zy #ly#][!SetVariable lx #CURRENTCONFIGX#][!SetVariable ly #CURRENTCONFIGY#][!UpdateMeasure mzOrigxy]
There might be an issue elsewhere in the code, but it is manifesting as an incompleted fade unless the mouse is moved, not a problem since I move the mouse down anyway, but it never happened in earlier versions.
I wish I could blank or move the mouse automatically, I tried a blank cursor but couldn't get it to work, will try it again in 4.3.
zin