It is currently March 28th, 2024, 10:20 am

Laptop power/battery skin

Get help with creating, editing & fixing problems with skins
Post Reply
Bub
Posts: 37
Joined: April 2nd, 2014, 3:52 pm

Laptop power/battery skin

Post by Bub »

G'day guys

Pretty much sure I'm not the first and not the last one who's been seeking for a help for this skin.
Been looking for an ideas in how to make a skin but couldn't find enough (right?) info.
If someone can help me out... Well it will be perfect :bow:

Been trying to make something like this:

Image

While on battery it's a normal static bar with hours and %
When plugged and charging it will show "charging" instead of time and % of charge.
-------------
It will be more than perfect if someone will explain to me how to animate those "charging" bars in rainmeter, probably just a two frame gif or what?
-------------
When full charged and just plugged it will show full bar, nothing on the left and 100% on right.
-------------
And again, is it possible to make top pinky bar slowly breath from 0 to 100 opacity over like few sec?
Just to bring some diff between charged and battery skin
-------------

If, my good g'men, all those animated crap is way too much for you I'll be more than happy to get your help create this skin without anything fancy schmancy :D
Don't get crazy over those colors on picture, just picked up to contrast one to show the idea :lol:
Thanks in advance and have a great day! :welcome:
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Laptop power/battery skin

Post by balala »

Bub wrote:While on battery it's a normal static bar with hours and %
When plugged and charging it will show "charging" instead of time and % of charge.
This is what the PowerPlugin returns in such cases and as far as I know, you can't do this otherwise. But in fact, when charging, there isn't a "left" time, so there make no sense to return and show the "time".
Bub wrote:It will be more than perfect if someone will explain to me how to animate those "charging" bars in rainmeter, probably just a two frame gif or what?
An animated gif could really help, but Rainmeter can't display animated gifs. Instead, here is a good description of how can you use and display animated gifs: https://docs.rainmeter.net/tips/animated-gif-files/
Bub wrote:And again, is it possible to make top pinky bar slowly breath from 0 to 100 opacity over like few sec?
Just to bring some diff between charged and battery skin
When this should have to happen? I think it is possible, but what I don't understand is when it should have to change its opacity.
Bub
Posts: 37
Joined: April 2nd, 2014, 3:52 pm

Re: Laptop power/battery skin

Post by Bub »

balala wrote:This is what the PowerPlugin returns in such cases and as far as I know, you can't do this otherwise. But in fact, when charging, there isn't a "left" time, so there make no sense to return and show the "time".
I was talking 'bout time left for laptop to operate on what's left from battery charge. Like when you mouse over lil' battery icon on taskbar it show you aprox time left to operate. That is all. And only while running on battery.
When charging it should show "charging" like on the pic, no time or such.
balala wrote: An animated gif could really help, but Rainmeter can't display animated gifs. Instead, here is a good description of how can you use and display animated gifs: https://docs.rainmeter.net/tips/animated-gif-files/
I'll take a look, thanks.
I though there is some features inside RM to "animate" bars but seems like no.
So all people who use animated elements in their skins - they are using some gif files?
balala wrote: When this should have to happen? I think it is possible, but what I don't understand is when it should have to change its opacity.
While it's fully charged and still plugged to power. Just a top pinky bar "breathing" in and out in like 2-3 sec period.
I was able to do so few years back, but couldn't find all saved test skins and elements... Probably lost with HDD crashed few years back.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5380
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA
Contact:

Re: Laptop power/battery skin

Post by eclectic-tech »

The best way to get what you are looking for is to modify a skin that does most of what you want...

Below is slightly modified copy of Win10 Widgets Large Battery skin by TJ Markham. It has a license that allows using it non-commercially, with proper crediting; Creative Commons BY-NC-SA 4.0. I removed the @includes, but copied the styles.inc sections into this code, for alignment purposes.

This will give you a skin with all the MEASURES you need.
From here, you can modify the METERS so they display the measured information in the style you want.

This skin may not be the best example to try to follow because of all the styles, but it will provide all the critical measurements you are asking for.

Code: Select all

; ------------------------------------------------------------------------
;    _       ___      _______     _       ___     __           __
;   | |     / (_)___ /  / __ \   | |     / (_)___/ /___  ___  / /______
;   | | /| / / / __ \/ / / / /   | | /| / / / __  / __ \/ _ \/ __/ ___/
;   | |/ |/ / / / / / / /_/ /    | |/ |/ / / /_/ / /_/ /  __/ /_(__  ) 
;   |__/|__/_/_/ /_/_/\____/     |__/|__/_/\__,_/\__, /\___/\__/____/
;                                               /____/
;
;	Win10 Widgets for Rainmeter - Battery (large)
;		Author  - TJ Markham, http://tjmarkham.com
;		Website - http://win10widgets.com
;		Donate  - http://donate.win10widgets.com
;
; ------------------------------------------------------------------------

; Known bug(s):
; - When "Not charging" is shown in Windows, "Charging" is shown in the 
;	widget. Looked at "PowerState=Status" and "PowerState=Status2" from 
;	the Power plug-in, but they provided no indication as to when "Not 
;	charging" should be shown.
; - When "battery saver" is active, no additional icon is shown. Looked 
;	at "PowerState=Status" and "PowerState=Status2" from the Power 
;	plug-in, but they provided no indication as to when "battery saver" 
;	was active.
; - When battery is charging, Windows shows the time until the battery is
;	fully charged whereas the widget just shows "Charging". Unaware of a 
;	way to replicate this Windows functionality in Rainmeter at time of 
;	release.
; - While the Windows battery icon shows "low" and "very low" battery 
;	level warning icons, the widget battery icon does not. Looked at 
;	"PowerState=Status" and "PowerState=Status2" from the Power plug-in,
;	but they provided no indication as to when the "low" and "very low" 
;	battery thresholds were reached. Since these values vary from system 
;	to system, this feature cannot be properly implemented by 
;	"hard coding" the threshold levels.

[Rainmeter]
Update=100

[Metadata]
Name=Battery (large)
Author=TJ Markham
Information=Displays the current battery status.
License=Creative Commons BY-NC-SA 4.0
Version=1.0.0

[Variables]
; No includes are needed
; I copied the styles sections below for alignment purposes
; @Include1=#@#variables.ini
; @Include3=#@#background.ini
; CoreFilePath=""#CURRENTPATH#Battery-Large.ini""
BackgroundHeight=78
BatteryIconColor=255,255,255,255
hrS=s
minS=s
BatteryBarWidth=40
LeftPadding=81
TopPadding=5
AutoBorder=1


; About:
;	Sets styles and makes them available to skins that include the 
;	"styles.ini" file.

[StyleWhiteText]
FontColor=#SolidWhite#

[StyleBlackText]
FontColor=#SolidBlack#

[StyleErrorText]
FontColor=#SolidRed#

[StyleWindowsColorText]
FontColor=#WindowsColorText#
Group=WindowsTextColorGroup

[StyleLeftAlign]
StringAlign=Left

[StyleRightAlign]
StringAlign=Right

[StyleCenterAlign]
StringAlign=Center

[StyleBigText]
H=70
AntiAlias=1
FontFace=Segoe UI Light
FontSize=35
FontColor=#SolidWhite#
StringAlign=Left
ClipString=1

[StyleMediumText]
AntiAlias=1
FontFace=Segoe UI
FontSize=18
FontColor=#SolidWhite#
StringAlign=Left
ClipString=1

[StyleSmallText]
H=21
AntiAlias=1
FontFace=Segoe UI
FontSize=11
FontColor=#SolidGreyText#
StringAlign=Left
ClipString=1

[StyleTinyText]
AntiAlias=1
FontFace=Segoe UI
FontSize=9
FontColor=#SolidGreyText#
StringAlign=Left
ClipString=1

[StyleSmallTextSpotify]
H=19
AntiAlias=1
FontFace=Segoe UI
FontSize=10
FontColor=#SolidGreyText#
StringAlign=Left
ClipString=1

[StyleTinyTextSpotify]
AntiAlias=1
FontFace=Segoe UI
FontSize=8
FontColor=#SolidGreyText#
StringAlign=Right
ClipString=1

[StyleVolumeBarSense]
X=0R
Y=0r
W=2
H=#BackgroundHeight#
Hidden=1
SolidColor=#Transparent#
Group=Sense
UpdateDivider=-1

[StyleHDSelect]
X=1R
Y=0r
W=22
H=22
Hidden=1
SolidColor=#TransparentWhite3#
AntiAlias=1
Group=HDSelect
FontFace=Segoe UI
FontSize=12
FontColor=#SolidWhite#
StringAlign=Center
ClipString=1
LeftMouseDownAction=[!SetOption #CURRENTSECTION# SolidColor #TransparentWhite1#][!UpdateMeter #CURRENTSECTION#]
LeftMouseUpAction=[!SetOption #CURRENTSECTION# SolidColor #TransparentWhite2#][!WriteKeyValue Variables Disk #CURRENTSECTION# #CoreFilePath#][!Refresh]
MouseOverAction=[!SetOption #CURRENTSECTION# SolidColor #TransparentWhite2#][!UpdateMeter #CURRENTSECTION#]
MouseLeaveAction=[!SetOption #CURRENTSECTION# SolidColor #TransparentWhite3#][!UpdateMeter #CURRENTSECTION#]
UpdateDivider=-1

[StyleHDOff]
X=1R
Y=0r
W=22
H=22
Hidden=1
SolidColor=#TransparentWhite3#
AntiAlias=1
Group=HDSelect
FontFace=Segoe UI
FontSize=12
FontColor=#TransparentWhite3#
StringAlign=Center
ClipString=1
UpdateDivider=-1
; ------------------------------------------------------------------------
; MEASURES
; ------------------------------------------------------------------------

[MeasureBatteryACLine]
; Returns the status of the AC Line (0 for battery or 1 when plugged in).
; Controls the charging vs. discharging functionality.
Measure=Plugin
Plugin=PowerPlugin
PowerState=ACLine
IfEqualValue=1
IfEqualAction=[!HideMeterGroup Discharging][!HideMeterGroup TimeRemaining][!HideMeter Remaining][!ShowMeter ChargingStatus][!HideMeter ChargedStatus][!ShowMeterGroup BatteryCharging][!HideMeter Calculating]
IfBelowValue=1
IfBelowAction=[!ShowMeterGroup Discharging][!HideMeter ChargingStatus][!HideMeter ChargedStatus][!HideMeterGroup BatteryCharging][!ShowMeter Calculating]

[MeasureBatteryPercent]
; Returns the percentage of charge remaining in the battery.
; Controls the visibility of the "Charged" text.
; Controls the anti-aliasing pixels of the charging battery icon.
Measure=Plugin
Plugin=PowerPlugin
PowerState=Percent
OnChangeAction=[!UpdateMeasure MeasureBatteryBarCharging][!UpdateMeter MeterBatteryBarDischarging][!UpdateMeter MeterBatteryBarCharging][!UpdateMeter MeterBatteryPercent][!UpdateMeter Remaining]
IfCondition=(MeasureBatteryPercent=100) && (MeasureBatteryACLine=1)
IfTrueAction=[!HideMeterGroup Discharging][!HideMeterGroup TimeRemaining][!HideMeter ChargingStatus][!ShowMeter ChargedStatus][!ShowMeterGroup BatteryCharging][!ShowMeterGroup BatteryChargingAntiAlias]
IfCondition2=(MeasureBatteryPercent<10) && (MeasureBatteryACLine=1)
IfTrueAction2=[!HideMeterGroup BatteryChargingAntiAlias]
IfCondition3=(MeasureBatteryPercent>=10) && (MeasureBatteryACLine=1)
IfTrueAction3=[!ShowMeterGroup BatteryChargingAntiAlias]
IfConditionMode=1

[MeasureBatteryHours]
; Returns the estimated number of hours the battery will last.
; Controls the plurality of the hour measurement.
; Controls the visibility of the hour measurement.
Measure=Plugin
Plugin=PowerPlugin
PowerState=Lifetime
Substitute="Unknown":"-1","":"-1"
Format=%#H
OnChangeAction=[!UpdateMeter MeterBatteryHours]
IfMatch=^1$
IfMatchAction=!SetVariable hrS ""
IfNotMatchAction=!SetVariable hrS "s"
IfMatch2=^0$
IfMatchAction2=[!HideMeter MeterBatteryHours]
IfCondition=([MeasureBatteryHours] > 0)
IfTrueAction=[!ShowMeter MeterBatteryHours][!ShowMeter Remaining][!HideMeter Calculating]]
IfCondition2=([MeasureBatteryHours] < 0)
IfTrueAction2=[!HideMeter MeterBatteryHours][!HideMeter Remaining]
DynamicVariables=1
IfConditionMode=1

[MeasureBatteryMinutes]
; Returns the estimated number of minutes the battery will last.
; Controls the plurality of the minute measurement.
; Controls the visibility of the minute measurement.
Measure=Plugin
Plugin=PowerPlugin
PowerState=Lifetime
Substitute="Unknown":"-1","":"-1"
Format=%#M
OnChangeAction=[!UpdateMeter MeterBatteryMinutes]
IfMatch=^1$
IfMatchAction=!SetVariable minS ""
IfNotMatchAction=!SetVariable minS "s"
IfMatch2=^0$
IfMatchAction2=[!HideMeter MeterBatteryMinutes]
IfCondition=([MeasureBatteryMinutes] > 0)
IfTrueAction=[!ShowMeter MeterBatteryMinutes][!ShowMeter Remaining][!HideMeter Calculating]
IfCondition2=([MeasureBatteryMinutes] < 0)
IfTrueAction2=[!HideMeter MeterBatteryMinutes][!HideMeter Remaining]
DynamicVariables=1
IfConditionMode=1

[MeasureBatteryBarCharging]
Measure=Calc
Formula=((MeasureBatteryPercent/100)*#BatteryBarWidth#)
OnChangeAction=[!UpdateMeter MeterBatteryBarCharging1][!UpdateMeter MeterBatteryBarCharging2][!UpdateMeter MeterBatteryBarCharging3][!UpdateMeter MeterBatteryBarCharging4]
UpdateDivider=-1


; ------------------------------------------------------------------------
; METERS - Shared Battery Icon Components
; ------------------------------------------------------------------------

[BatteryNub]
; Shows the "nub" of the battery icon.
Meter=Image
X=69
Y=(#TopPadding#+32)
W=2
H=4
SolidColor=#BatteryIconColor#
UpdateDivider=-1

[BatteryRightBorder]
; Shows the right border of the charging battery icon.
Meter=Image
X=-2r
Y=-10r
W=2
H=24
SolidColor=#BatteryIconColor#
UpdateDivider=-1


; ------------------------------------------------------------------------
; METERS - Discharging Battery Bar/Icon
; ------------------------------------------------------------------------

[MeterBatteryBarDischarging]
; Shows the percentage of charge remaining in the battery in the from of a bar.
Meter=Bar
MeasureName=MeasureBatteryPercent
X=([BatteryNub:X]-44)
Y=([BatteryNub:Y]-6)
W=#BatteryBarWidth#
H=16
Group=Discharging
BarColor=255,255,255,255
BarOrientation=Horizontal
UpdateDivider=-1

[BatteryDischargingTopBorder]
; Shows the top border of the discharging battery icon.
Meter=Image
X=-4r
Y=-4r
W=48
H=2
SolidColor=#BatteryIconColor#
Group=Discharging
UpdateDivider=-1

[BatteryDischargingLeftBorder]
; Shows the left border of the discharging battery icon.
Meter=Image
X=0r
Y=0r
W=2
H=24
SolidColor=#BatteryIconColor#
Group=Discharging
UpdateDivider=-1

[BatteryDischargingBottomBorder]
; Shows the bottom border of the discharging battery icon.
Meter=Image
X=0r
Y=22r
W=48
H=2
SolidColor=#BatteryIconColor#
Group=Discharging
UpdateDivider=-1


; ------------------------------------------------------------------------
; METERS - Charging Battery Bar
; ------------------------------------------------------------------------

[MeterBatteryBarCharging]
; Shows the percentage of charge remaining in the battery in the from of a bar.
; Bottom-most section of charging bar.
Meter=Bar
MeasureName=MeasureBatteryPercent
X=[MeterBatteryBarDischarging:X]
Y=([BatteryNub:Y]+1)
W=#BatteryBarWidth#
H=9
Group=BatteryCharging
BarColor=255,255,255,255
BarOrientation=Horizontal
UpdateDivider=-1

[MeterBatteryBarCharging1]
; Shows the percentage of charge remaining in the battery in the from of a bar.
; First "short" bar from the bottom due to plug icon.
Meter=Line
MeasureName=MeasureBatteryBarCharging
X=1r
Y=-1r
W=([MeasureBatteryBarCharging:]-1)
H=1
SolidColor=255,255,255,255
Group=BatteryCharging
LineCount=0
LineWidth=0
DynamicVariables=1
UpdateDivider=-1

[MeterBatteryBarCharging2]
; Shows the percentage of charge remaining in the battery in the from of a bar.
; Second "short" bar from the bottom due to plug icon.
Meter=Line
MeasureName=MeasureBatteryBarCharging
X=1r
Y=-1r
W=([MeasureBatteryBarCharging:]-2)
H=1
SolidColor=255,255,255,255
Group=BatteryCharging
LineCount=0
LineWidth=0
DynamicVariables=1
UpdateDivider=-1

[MeterBatteryBarCharging3]
; Shows the percentage of charge remaining in the battery in the from of a bar.
; Third "short" bar from the bottom due to plug icon.
Meter=Line
MeasureName=MeasureBatteryBarCharging
X=1r
Y=-1r
W=([MeasureBatteryBarCharging:]-3)
H=1
SolidColor=255,255,255,255
Group=BatteryCharging
LineCount=0
LineWidth=0
DynamicVariables=1
UpdateDivider=-1

[MeterBatteryBarCharging4]
; Shows the percentage of charge remaining in the battery in the from of a bar.
; Fourth "short" bar from the bottom due to plug icon.
Meter=Line
MeasureName=MeasureBatteryBarCharging
X=1r
Y=-4r
W=([MeasureBatteryBarCharging:]-4)
H=4
SolidColor=255,255,255,255
Group=BatteryCharging
LineCount=0
LineWidth=0
DynamicVariables=1
UpdateDivider=-1

[MeterBatteryBarChargingAntiAlias1]
; Shows the top semi-transparent white pixel that acts as an anti-aliasing measure for the curved section of the battery charging bar.
Meter=Image
X=([BatteryNub:X]-41)
Y=([MeterBatteryBarCharging:Y]-5)
W=1
H=1
SolidColor=255,255,255,100
Group=BatteryChargingAntiAlias
UpdateDivider=-1

[MeterBatteryBarChargingAntiAlias2]
; Shows the bottom semi-transparent white pixel that acts as an anti-aliasing measure for the curved section of the battery charging bar.
Meter=Image
X=0r
Y=1r
W=1
H=1
SolidColor=255,255,255,155
Group=BatteryChargingAntiAlias
UpdateDivider=-1


; ------------------------------------------------------------------------
; METERS - Charging Battery Icon
; ------------------------------------------------------------------------

[BatteryChargingTopBorder]
; Shows the top border of the charging battery icon.
Meter=Image
X=([BatteryDischargingTopBorder:X]+8)
Y=[BatteryDischargingTopBorder:Y]
W=40
H=2
SolidColor=#BatteryIconColor#
Group=BatteryCharging
UpdateDivider=-1

[BatteryChargingTopBorder2]
; Shows the top border of the plug in the charging battery icon.
Meter=Image
X=-12r
Y=0r
W=10
H=2
SolidColor=#BatteryIconColor#
Group=BatteryCharging
UpdateDivider=-1

[BatteryChargingProng1]
; Shows the left prong of the plug in the charging battery icon.
Meter=Image
X=2r
Y=-4r
W=2
H=4
SolidColor=#BatteryIconColor#
Group=BatteryCharging
UpdateDivider=-1

[BatteryChargingProng2]
; Shows the right prong of the plug in the charging battery icon.
Meter=Image
X=4r
Y=0r
W=2
H=4
SolidColor=#BatteryIconColor#
Group=BatteryCharging
UpdateDivider=-1

[BatteryChargingPlug1]
; Shows the left border of the plug in the charging battery icon.
Meter=Image
X=[BatteryChargingTopBorder2:X]
Y=6r
W=2
H=3
SolidColor=#BatteryIconColor#
Group=BatteryCharging
UpdateDivider=-1

[BatteryChargingPlug2]
; Shows the right border of the plug in the charging battery icon.
Meter=Image
X=8r
Y=0r
W=2
H=3
SolidColor=#BatteryIconColor#
Group=BatteryCharging
UpdateDivider=-1

[BatteryChargingPlugRound]
; Shows the bottom curve of the plug in the charging battery icon.
Meter=Roundline
X=-3r
Y=3r
AntiAlias=1
Group=BatteryCharging
StartAngle=0
RotationAngle=3.2
LineStart=3
LineLength=5
LineColor=#BatteryIconColor#
Solid=1
UpdateDivider=-1

[BatteryChargingLeftBorder]
; Shows the left border of the charging battery icon.
Meter=Image
X=-1r
Y=3r
W=2
H=16
SolidColor=#BatteryIconColor#
Group=BatteryCharging
UpdateDivider=-1

[BatteryChargingBottomBorder]
; Shows the bottom border of the charging battery icon.
Meter=Image
X=4r
Y=14r
W=43
H=2
SolidColor=#BatteryIconColor#
Group=BatteryCharging
UpdateDivider=-1


; ------------------------------------------------------------------------
; METERS - Text
; ------------------------------------------------------------------------

[MeterBatteryPercent]
; Shows the percentage of charge remaining in the battery.
Meter=String
MeterStyle=StyleBigText
MeasureName=MeasureBatteryPercent
X=#LeftPadding#
Y=#TopPadding#
Text="%1"
UpdateDivider=-1

[Percent]
; Shows "%".
Meter=String
MeterStyle=StyleBigText
X=-16R
Y=0r
Text="%"
UpdateDivider=-1

[MeterBatteryHours]
; Shows the estimated number of hours the battery will last.
Meter=String
MeterStyle=StyleSmallText
MeasureName=MeasureBatteryHours
X=5R
Y=12r
Group=TimeRemaining
Text="%1 hour#hrS#"
DynamicVariables=1
UpdateDivider=-1

[MeterBatteryMinutes]
; Shows the estimated number of minutes the battery will last.
Meter=String
MeterStyle=StyleSmallText
MeasureName=MeasureBatteryMinutes
X=0R
Y=0r
Group=TimeRemaining
Text="%1 minute#minS#"
DynamicVariables=1
UpdateDivider=-1

[Remaining]
; Shows "Remaining".
Meter=String
MeterStyle=StyleSmallText
X=[MeterBatteryHours:X]
Y=20r
Text="remaining"
DynamicVariables=1
UpdateDivider=-1

[ChargingStatus]
; Shows "Charging".
Meter=String
MeterStyle=StyleSmallText
X=0r
Y=(#TopPadding#+22)
Text="Charging"
UpdateDivider=-1

[ChargedStatus]
; Shows "Fully charged".
Meter=String
MeterStyle=StyleSmallText
X=0r
Y=[ChargingStatus:Y]
Text="Fully charged"
UpdateDivider=-1

[Calculating]
; Shows "Calculating...".
Meter=String
MeterStyle=StyleSmallText
X=0r
Y=[ChargingStatus:Y]
Text="Calculating..."
UpdateDivider=-1
win10Batt.png
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Laptop power/battery skin

Post by balala »

When eclectic-tech posted his code, I've already started to write my own reply, so I'll post mine, too.
So, beside his above code, here is another, which takes into account your requests, Bub. Please check it and let me know what you think.

Code: Select all

[Rainmeter]
Update=1000
BackgroundMode=2
SolidColor=80,80,80,220
SkinWidth=290
SkinHeight=45

[StringStyle]
FontColor=220,220,220
FontSize=8
FontFace=Segoe UI
StringStyle=BOLD
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
Substitute="0":"BATTERY","1":"PLUGGED"
IfCondition=(#CURRENTSECTION#=0)
IfTrueAction=[!SetOption MeterStatusLifetime MeasureName "MeasureLifetime"][!UpdateMeasure "MeterStatusLifetime"]
IfFalseAction=[!SetOption MeterStatusLifetime MeasureName "MeasureStatus"][!UpdateMeasure "MeterStatusLifetime"]

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

[MeterBattery]
MeasureName=MeasureACLine
Meter=STRING
MeterStyle=StringStyle
X=80
Y=15
StringAlign=RightCenter

[MeterBatteryBar]
MeasureName=MeasurePercent
Meter=BAR
X=5r
Y=-10r
W=200
H=20
BarColor=183,37,182
SolidColor=0,154,180
BarOrientation=Horizontal

[MeterStatusLifetime]
Meter=STRING
MeterStyle=StringStyle
X=0r
Y=3R
StringAlign=Left

[MeterPercent]
MeasureName=MeasurePercent
Meter=STRING
MeterStyle=StringStyle
X=200r
Y=0r
StringAlign=Right
Postfix=%
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5380
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA
Contact:

Re: Laptop power/battery skin

Post by eclectic-tech »

You spent some time on this!... :thumbup:

Bub should appreciate that you took the time to create graphics that match his request.

ASIDE:
Although I have been guilty of doing the same thing (creating a complete skin per the request), I think it might be better to show them examples, and let them incorporate those into their own design. (Not a pick on you balala :17denial , just my opinion...)

I have been trying to resist my interest in creating complete projects from forum ideas, in the hope that more can be learned by letting them try it, make mistakes, and come back to learn more. :D

So far, I haven't succeeded in resisting... :x

Between the two, this should be a pretty straight forward build... :great:
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Laptop power/battery skin

Post by balala »

eclectic-tech wrote:Although I have been guilty of doing the same thing (creating a complete skin per the request), I think it might be better to show them examples, and let them incorporate those into their own design. (Not a pick on you balala :17denial , just my opinion...)
You're completely right, I agree. I just wrote the posted example code and posted it, but it's indeed a kind of reply to a request. :17oops
User avatar
fonpaolo
Moderator
Posts: 1387
Joined: April 11th, 2013, 8:08 pm
Location: Italy
Contact:

Re: Laptop power/battery skin

Post by fonpaolo »

Well, let's put aside the fact that you're both guilty... :lol:

Going back to what Bub is asking, I was trying to find a solution to mimic the remaining time (in minutes) of when the battery is discharging.
Theoretically, verifying the difference between the percentage of the battery at the beginning (or after the last reading) and after some time (a couple of minutes?), it's possible to estimate the remaining time, I know this can't be linear, but with a certain degree of approximation... :17what
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5380
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA
Contact:

Re: Laptop power/battery skin

Post by eclectic-tech »

fonpaolo wrote:Well, let's put aside the fact that you're both guilty... :lol:

Going back to what Bub is asking, I was trying to find a solution to mimic the remaining time (in minutes) of when the battery is discharging.
Theoretically, verifying the difference between the percentage of the battery at the beginning (or after the last reading) and after some time (a couple of minutes?), it's possible to estimate the remaining time, I know this can't be linear, but with a certain degree of approximation... :17what
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
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Laptop power/battery skin

Post by balala »

EDIT: Sorry eclectic-tech, you beat me again at this point...
fonpaolo wrote:Going back to what Bub is asking, I was trying to find a solution to mimic the remaining time (in minutes) of when the battery is discharging.
Theoretically, verifying the difference between the percentage of the battery at the beginning (or after the last reading) and after some time (a couple of minutes?), it's possible to estimate the remaining time, I know this can't be linear, but with a certain degree of approximation... :17what
Does this worth? The PowerState=Lifetime option of the Battery Plugin measure, returns exactly this info. Without having to use any this kind of calculations. Much easier, isn't it?
Post Reply