It is currently May 6th, 2024, 3:06 pm

Delay in battery skin

Get help with creating, editing & fixing problems with skins
User avatar
JpsCrazy
Posts: 667
Joined: April 18th, 2010, 2:16 pm
Location: NY, USA

Delay in battery skin

Post by JpsCrazy »

When I plug my power in the charging icon for my battery skin pops up immediately, but when removed from power it takes almost 20 seconds to disappear from the skin.
Now, what would cause that?

Also, it's great to be back, and I missed you all.

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1

[Variables]
BarColor=
Charging=

[mtBack]
Meter=IMAGE
ImageName=Battery.png
W=75
Antialias=1

[msBatteryPercent]
Measure=Plugin
Plugin=Plugins\PowerPlugin.dll
PowerState=PERCENT

[msCalcColor]
Measure=Calc
Formula=([msBatteryPercent]>30?2:([msBatteryPercent]>15?1:0))
DynamicVariables=1
IfAboveValue=1
IfAboveAction=!Execute [!RainmeterSetVariable BarColor 0,255,20,150] [!RainmeterRedraw]
IfEqualValue=1
IfEqualAction=!Execute [!RainmeterSetVariable BarColor 255,255,20,150] [!RainmeterRedraw]
IfBelowValue=1
IfBelowAction=!Execute [!RainmeterSetVariable BarColor 255,0,20,150] [!RainmeterRedraw]

[msLifetime]
Measure=Plugin
Plugin=Plugins\PowerPlugin.dll
PowerState=Lifetime
Substitute="Unknown":"AC"
Format=%#H:%M

[mtBattery]
Meter=Bar
MeasureName=msBatteryPercent
X=5
Y=20
W=62
H=32
Barcolor=#BarColor#
BarOrientation=Horizontal
DynamicVariables=1
MouseOverAction=!Execute [!RainmeterShowMeter mtPercent] [!RainmeterShowMeter mtLifetime] [!RainmeterRedraw]
MouseLeaveAction=!Execute [!RainmeterHideMeter mtPercent] [!RainmeterHideMeter mtLifetime] [!RainmeterRedraw]

[mtCharging]
Meter=Image
ImageName=[msLifetime].png
X=22
Y=22
W=25
Antialias=1
DynamicVariables=1

[mtPercent]
Meter=String
Text=[msBatteryPercent]%
FontFace=Courier New
X=20
Y=30
Antialias=1
DynamicVariables=1
Hidden=1

[mtLifetime]
Meter=String
Text=[msLifetime]
FontFace=Book Antiqua
X=20
Y=55
Antialias=1
DynamicVariables=1
Hidden=1
User avatar
Kaelri
Developer
Posts: 1721
Joined: July 25th, 2009, 4:47 am

Re: Delay in battery skin

Post by Kaelri »

Welcome back. :)

I'm not sure how this skin is meant to work. These look like the relevant sections:

Code: Select all

[msLifetime]
Measure=Plugin
Plugin=Plugins\PowerPlugin.dll
PowerState=Lifetime
Substitute="Unknown":"AC"
Format=%#H:%M

Code: Select all

[mtCharging]
Meter=Image
ImageName=[msLifetime].png
X=22
Y=22
W=25
Antialias=1
DynamicVariables=1
But surely you don't have a different .PNG file for every possible value of [msLifetime]?

Anyway, regardless of that issue, my suggestion would be to use the Power plugin's "ACLINE" setting:

Code: Select all

[msPower]
Measure=Plugin
Plugin=Plugins\PowerPlugin.dll
PowerState=ACLINE
This will simply return "1" if the power is plugged in, and "0" if not. It should also update almost immediately when the cord is plugged in or removed.
User avatar
JpsCrazy
Posts: 667
Joined: April 18th, 2010, 2:16 pm
Location: NY, USA

Re: Delay in battery skin

Post by JpsCrazy »

...well, guess I should've read more of the manual before I started asking questions again. Thanks!

And no, I just have the AC.png as the charging symbol and then it becomes *.png and since I don't have any of those images in that folder it just acts as hiding the meter. But with that tidbit of info I'll work something else out a bit nicer.
(I have seen some really cool clocks though with a different image for each image. Not the same situation though.)