It is currently April 26th, 2024, 11:26 pm

Laptop power/battery skin

Get help with creating, editing & fixing problems with skins
User avatar
fonpaolo
Moderator
Posts: 1387
Joined: April 11th, 2013, 8:08 pm
Location: Italy

Re: Laptop power/battery skin

Post by fonpaolo »

eclectic-tech wrote:Guilty as charged! ;-)

The PowerState=Lifetime option of the Power plugin can give you that information... It is used in the code I posted. :D
Well, I'm asking just because in my case it's always zero, so I disabled the measure and I'm trying to find a solution.
Even if Windows is able to give the remaining time, the reading by Power Plugin doesn't work at all. :17angry

edited to add: note, I'm not using a laptop, but a desktop computer with UPS.
User avatar
balala
Rainmeter Sage
Posts: 16174
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Laptop power/battery skin

Post by balala »

fonpaolo wrote:Well, I'm asking just because in my case it's always zero, so I disabled the measure and I'm trying to find a solution.
Even if Windows is able to give the remaining time, the reading by Power Plugin doesn't work at all. :17angry
Are you on a notebook? Because a while ago I used a desktop which had a UPS, connected though USB to the device and as far as I remember, even that shown the appropriate left time.
User avatar
fonpaolo
Moderator
Posts: 1387
Joined: April 11th, 2013, 8:08 pm
Location: Italy

Re: Laptop power/battery skin

Post by fonpaolo »

balala wrote:Are you on a notebook? Because a while ago I used a desktop which had a UPS, connected though USB to the device and as far as I remember, even that shown the appropriate left time.
No, as I said, my computer has a UPS, Windows reads the time remaining correctly but not Power Plugin.
It's an APC, which has software with many more readings, but also Windows uses the same technology (if I remember correctly given or created jointly between APC and Microsoft), so, if I install the software, windows can't read anything, if I use the standard Windows application, the readings are ok, but not the lifetime.
User avatar
balala
Rainmeter Sage
Posts: 16174
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Laptop power/battery skin

Post by balala »

fonpaolo wrote:No, as I said, my computer has a UPS, Windows reads the time remaining correctly but not Power Plugin.
It's an APC, which has software with many more readings, but also Windows uses the same technology (if I remember correctly given or created jointly between APC and Microsoft), so, if I install the software, windows can't read anything, if I use the standard Windows application, the readings are ok, but not the lifetime.
:confused: Weird. As I said mine read it correctly. At least as far as I can tell, because I don't use the desktop more then a year, but I think it read it correctly, both in Windows and in Rainmeter, through the PowerPlugin. :confused:
User avatar
fonpaolo
Moderator
Posts: 1387
Joined: April 11th, 2013, 8:08 pm
Location: Italy

Re: Laptop power/battery skin

Post by fonpaolo »

Mine never worked.
I have to test it with Windows 10 Pro, but very rarely I use it, because all the programs and so on are installed using Windows 7 Pro.
Not much time to test it properly or to look for a solution (maybe some broken registry key...)
The only alternative is to resurrect my old laptop and test my skin there, but now I use it once in a while...
User avatar
balala
Rainmeter Sage
Posts: 16174
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Laptop power/battery skin

Post by balala »

fonpaolo wrote:The only alternative is to resurrect my old laptop and test my skin there, but now I use it once in a while...
Me too, my desktop. However I'll give it a try tomorrow, to ensure I remember correctly.
Bub
Posts: 37
Joined: April 2nd, 2014, 3:52 pm

Re: Laptop power/battery skin

Post by Bub »

eclectic-tech & balala, right now I have no idea how to thank you enough for all you've done for me.
This forum always been helpful place and just prove it one more time.

My most warmly THANKS to you, guys. I am in your debt. :bow: :bow: :bow:

If I may ask few more questions without being banned for it... :lol:

SO here is a few things.
I've been asking if it's possible to make BarColor animated (in my case 2 or 4 png image sequence) while battery in charging mode only. As soon as rig unplugged or battery fully charged it changes back to normal BarColor color.

EDIT: Found the way to make animated bar, still looking for ideas 'bout question above.
EDIT: was able to make it to change bar from static color on unplugged to animated while plugged and charging.
Problem - animation speed. It doesn't matter what value in Update - 10 or 1000, it plays sequence at same speed...
Question - how to make it switch back to static color when fully charged?

And second question 'bout fade in - fade out effect when same damn bar showing "fully charged" and BarColor starts smoothly fade in/fade. Just a BarColor bar, the rest of meter stays the way it use to.
Been trying to reuse beautiful skin from Kaelri https://forum.rainmeter.net/viewtopic.php?t=12802 but it doesn't go right way. All I was able to achieve instead of fade in/out is partially color changes. Static one :rolmfao:

So once again THANK YOU GUYS SOOO MUCH FOR YOUR HELP!!! and plz don't kill me for all those questions. Just want to create nice look for my daughter's first gaming rig. She is only 11... :rosegift:
User avatar
balala
Rainmeter Sage
Posts: 16174
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Laptop power/battery skin

Post by balala »

Bub wrote:eclectic-tech & balala, right now I have no idea how to thank you enough for all you've done for me.
From my point of view, you don't have to. I'm glad to help, when I can.
Bub wrote:EDIT: Found the way to make animated bar, still looking for ideas 'bout question above.
EDIT: was able to make it to change bar from static color on unplugged to animated while plugged and charging.
Problem - animation speed. It doesn't matter what value in Update - 10 or 1000, it plays sequence at same speed...
Question - how to make it switch back to static color when fully charged?

And second question 'bout fade in - fade out effect when same damn bar showing "fully charged" and BarColor starts smoothly fade in/fade. Just a BarColor bar, the rest of meter stays the way it use to.
Been trying to reuse beautiful skin from Kaelri https://forum.rainmeter.net/viewtopic.php?t=12802 but it doesn't go right way. All I was able to achieve instead of fade in/out is partially color changes. Static one :rolmfao:
Please post the code you have so far, to can take a look. Would be much easier to help, if we could talk about an existing code, not just so, generally.
Bub
Posts: 37
Joined: April 2nd, 2014, 3:52 pm

Re: Laptop power/battery skin

Post by Bub »

Sure and sorry in advance for crappy mess :oops:

Code: Select all

[Rainmeter]

[Variables]
@include=#@#Options.inc
Update=100

;=============================================
;Background
;=============================================

[Meter.Background]
Meter=Image
X=0
Y=0
H=28
W=276
;SolidColor=38,201,157
SolidColor=#Background.color#



;=============================================
;Calc
;=============================================


[StringStyle]
StringAlign=left
FontColor=#FontColor#
FontSize=#FontHeight1#
FontFace=#Font#
AntiAlias=1
Text=%1

[MeasurePercent]
Measure=Plugin
PlugIn=PowerPlugin
PowerState=PERCENT

[MeasureStatus]
Measure=Plugin
PlugIn=PowerPlugin
PowerState=STATUS
Substitute="0":"NO BATTERY","1":"CHARGING","2":"CRITICAL","3":"LOW","4":"ABOVE LOW"


[MeasureACLine]
Measure=Plugin
PlugIn=PowerPlugin
PowerState=ACLINE
;X=40
;Y=4
;StringAlign=Right
FontColor=#FontColor#
FontSize=#FontHeight1#
FontFace=#Font#
AntiAlias=1
Substitute="0":"BATTERY","1":"PLUGGED"
IfCondition=(#CURRENTSECTION#=0)
IfTrueAction=[!SetOption MeterStatusLifetime MeasureName "MeasureLifetime"][!UpdateMeasure 

"MeterStatusLifetime"][!HideMeter MeterBatteryBar1][!ShowMeter MeterBatteryBar2]
IfFalseAction=[!SetOption MeterStatusLifetime MeasureName "MeasureStatus"][!UpdateMeasure "MeterStatusLifetime"]

[!HideMeter MeterBatteryBar2][!ShowMeter MeterBatteryBar1]

[MeasureLifetime]
Measure=Plugin
PlugIn=PowerPlugin
PowerState=LIFETIME
Format=%#Hh %Mm

[MeterBattery]
MeasureName=MeasureACLine
Meter=STRING
MeterStyle=StringStyle
FontColor=#FontColor#
FontSize=#FontHeight2#
FontFace=#Font#
X=51
Y=10
StringAlign=RightCenter


;=============================================
;Graphs
;=============================================



[MeterBatteryBar1]
MeasureName=MeasurePercent
Meter=BAR
X=56
Y=4
W=220
H=10
BarImage=Frames\bar2_[ImageNumberCalc].png
SolidColor=#graph.line2#
BarOrientation=Horizontal
DynamicVariables=1

[ImageNumberCalc]
Measure=Calc
Formula=Counter % 4


[MeterBatteryBar2]
MeasureName=MeasurePercent
Meter=BAR
X=56
Y=4
W=220
H=10
BarColor=#graph.line1#
SolidColor=#graph.line2#
BarOrientation=Horizontal



[MeterStatusLifetime]
Meter=STRING
MeterStyle=StringStyle
X=62
Y=18
StringAlign=Left

[MeterPercent]
MeasureName=MeasurePercent
Meter=STRING
MeterStyle=StringStyle
X=274
Y=0r
StringAlign=Right
Postfix=%
What I've been trying to do is first of all change Substitute parameters.
Right now it's Substitute="0":"NO BATTERY","1":"CHARGING","2":"CRITICAL","3":"LOW","4":"ABOVE LOW"
Been trying to figure out how to make it work this way - "CHARGING" till 99%, "CHARGED" at 100% OR even better nothing at %100 instead of "Charged" or "Above Low" or anything...

And then at 100% change from BarImage animated to BarColor solid color as it does right now between charging / on battery. If it possible to make BarColor after 100% charged fade in / fade out in circle of few seconds, it will be perfect. If it's too much headache, then just change to solid color or image (if you can show me both options... :oops: )

And last problem is control animation speed. Been trying to change Update numbers from 10 to 500 and nothing happens with speed. For sure I do something wrong but what...

Thanks a lot!!!
Last edited by Bub on March 23rd, 2018, 4:42 pm, edited 1 time in total.
User avatar
balala
Rainmeter Sage
Posts: 16174
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Laptop power/battery skin

Post by balala »

Bub wrote:Sure and sorry in advance for crappy mess :oops:
There is an issue with this code: it uses a lot of resources, which I don't have, but would be necessary (the Options.inc file, the images used in the [MeterBatteryBar1] meter and so on). So please pack the whole config and upload it.
Bub wrote:And last problem is control animation speed. Been trying to change Update numbers from 10 to 500 and nothing happens with speed. For sure I do something wrong but what...
If you mean you've changed the value of the Update variable (set up in the [Variables] section as Update=100), well, this is a completely useless process, because you used nowhere this variable, so it doesn't influence anything in the skin.