It is currently May 8th, 2024, 4:24 am
Toggle between Power Options and variable meter image
-
- Posts: 5
- Joined: December 3rd, 2017, 6:35 am
Re: Toggle between Power Options and variable meter image
Hahaha well before posting here I was crawling through old posts and your name kept popping up to resolve issues for people. Let's just say you're a very helpful guy, it's much appreciated
-
- Rainmeter Sage
- Posts: 16202
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
-
- Posts: 44
- Joined: December 5th, 2017, 5:58 pm
Re: Toggle between Power Options and variable meter image
hello. how to make this working with separated buttons that every buttons has his own function?
example,
O - Power save,
O - Balanced,
O - High
example,
O - Power save,
O - Balanced,
O - High
-
- Rainmeter Sage
- Posts: 16202
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Toggle between Power Options and variable meter image
Create three Button meters, one for each power scheme. Use the appropriate options for each of them, as you want (ButtonImage, X, Y and so on - I don't post these, just the essence, the appropriate ButtonCommand options). Use the following ButtonCommand options for them:nikko wrote:hello. how to make this working with separated buttons that every buttons has his own function?
Code: Select all
[MeterPowerSave]
Meter=Button
...
ButtonCommand=[!SetOption MeasureRun Parameter "POWERCFG /SETACTIVE 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c"][!CommandMeasure "MeasureRun" "Run"]
[MeterBalanced]
Meter=Button
...
ButtonCommand=[!SetOption MeasureRun Parameter "POWERCFG /SETACTIVE 381b4222-f694-41f0-9685-ff5bb260df2e"][!CommandMeasure "MeasureRun" "Run"]
[MeterHigh]
Meter=Button
...
ButtonCommand=[!SetOption MeasureRun Parameter "POWERCFG /SETACTIVE a1841308-3541-4fab-bc81-f71556f20b4a"][!CommandMeasure "MeasureRun" "Run"]
-
- Posts: 44
- Joined: December 5th, 2017, 5:58 pm
Re: Toggle between Power Options and variable meter image
this not working well:
Code: Select all
[Variables]
high=High
balance=Balanced
saver=saver
Power=0
[MeasureRun]
Measure=Plugin
Plugin=RunCommand
State=Hide
[MeasureActivePower]
Measure=Registry
RegHKey=HKEY_LOCAL_MACHINE
RegKey=SYSTEM\ControlSet001\Control\Power\User\PowerSchemes
RegValue=ActivePowerScheme
Substitute="8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c":"#high#","381b4222-f694-41f0-9685-ff5bb260df2e":"#balance#","a1841308-3541-4fab-bc81-f71556f20b4a":"#saver#"
DynamicVariables=1
[MeasurePower]
Measure=Calc
Formula=#Power#
IfCondition=(#CURRENTSECTION#=0)
IfTrueAction=[!SetOption MeasureRun Parameter "POWERCFG /SETACTIVE 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c"][!CommandMeasure "MeasureRun" "Run"]
IfCondition2=(#CURRENTSECTION#=1)
IfTrueAction2=[!SetOption MeasureRun Parameter "POWERCFG /SETACTIVE 381b4222-f694-41f0-9685-ff5bb260df2e"][!CommandMeasure "MeasureRun" "Run"]
IfCondition3=(#CURRENTSECTION#=2)
IfTrueAction3=[!SetOption MeasureRun Parameter "POWERCFG /SETACTIVE a1841308-3541-4fab-bc81-f71556f20b4a"][!CommandMeasure "MeasureRun" "Run"]
DynamicVariables=1
[MeterPowerSave]
Meter=String
MeasureName=MeasureActivePower
StringAlign=Center
FontColor=211,0,255
X=88
Y=30
Text=#saver#
LeftMouseUpAction=[!SetOption MeasureRun Parameter "POWERCFG /SETACTIVE 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c"][!CommandMeasure "MeasureRun" "Run"]
[MeterBalanced]
Meter=String
MeasureName=MeasureActivePower
StringAlign=Center
FontColor=255,0,0
X=88
Y=50
Text=#balance#
LeftMouseUpAction=[!SetOption MeasureRun Parameter "POWERCFG /SETACTIVE 381b4222-f694-41f0-9685-ff5bb260df2e"][!CommandMeasure "MeasureRun" "Run"]
[MeterHigh]
Meter=String
MeasureName=MeasureActivePower
StringAlign=Center
FontColor=0,111,0
X=88
Y=70
Text=#high#
LeftMouseUpAction=[!SetOption MeasureRun Parameter "POWERCFG /SETACTIVE a1841308-3541-4fab-bc81-f71556f20b4a"][!CommandMeasure "MeasureRun" "Run"]
-
- Rainmeter Sage
- Posts: 16202
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Toggle between Power Options and variable meter image
Yeah, probably my fault, sorry. Here is a fix:nikko wrote:this not working well:
Code: Select all
[Variables]
high=High
balance=Balanced
saver=saver
Power=0
[MeasureRun]
Measure=Plugin
Plugin=RunCommand
State=Hide
[MeasureActivePower]
Measure=Registry
RegHKey=HKEY_LOCAL_MACHINE
RegKey=SYSTEM\ControlSet001\Control\Power\User\PowerSchemes
RegValue=ActivePowerScheme
Substitute="8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c":"#high#","381b4222-f694-41f0-9685-ff5bb260df2e":"#balance#","a1841308-3541-4fab-bc81-f71556f20b4a":"#saver#"
DynamicVariables=1
[MeasurePower]
Measure=Calc
Formula=#Power#
IfCondition=(#CURRENTSECTION#=0)
IfTrueAction=[!SetOption MeasureRun Parameter "POWERCFG /SETACTIVE 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c"][!CommandMeasure "MeasureRun" "Run"]
IfCondition2=(#CURRENTSECTION#=1)
IfTrueAction2=[!SetOption MeasureRun Parameter "POWERCFG /SETACTIVE 381b4222-f694-41f0-9685-ff5bb260df2e"][!CommandMeasure "MeasureRun" "Run"]
IfCondition3=(#CURRENTSECTION#=2)
IfTrueAction3=[!SetOption MeasureRun Parameter "POWERCFG /SETACTIVE a1841308-3541-4fab-bc81-f71556f20b4a"][!CommandMeasure "MeasureRun" "Run"]
DynamicVariables=1
[MeterPowerSave]
Meter=String
MeasureName=MeasureActivePower
StringAlign=Center
FontColor=211,0,255
SolidColor=0,0,0,1
X=88
Y=30
Text=#saver#
LeftMouseUpAction=[!SetVariable Power "2"][!UpdateMeasure "MeasurePower"]
[MeterBalanced]
Meter=String
MeasureName=MeasureActivePower
StringAlign=Center
FontColor=255,0,0
SolidColor=0,0,0,1
X=88
Y=50
Text=#balance#
LeftMouseUpAction=[!SetVariable Power "1"][!UpdateMeasure "MeasurePower"]
[MeterHigh]
Meter=String
MeasureName=MeasureActivePower
StringAlign=Center
FontColor=0,111,0
SolidColor=0,0,0,1
X=88
Y=70
Text=#high#
LeftMouseUpAction=[!SetVariable Power "0"][!UpdateMeasure "MeasurePower"]
Sorry for the confusion.
Just as a side note, I mention I've added a SolidColor=0,0,0,1 option, to each of the [MeterPowerSave], [MeterBalanced] and [MeterHigh] meters. With these options will be much easier to click the meters.
-
- Posts: 44
- Joined: December 5th, 2017, 5:58 pm
Re: Toggle between Power Options and variable meter image
sorry, all clicks are 1 step late. After next click previous activate.
-
- Rainmeter Sage
- Posts: 16202
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Toggle between Power Options and variable meter image
Yeah, you're right, they indeed are.nikko wrote:sorry, all clicks are 1 step late. After next click previous activate.
To fix this, when the parameter option is set on the [MeasureRun] measure by the !SetOption bangs of the IfTrueActionX options of the [MeasurePower] measure, the [MeasureRun] measure should immediately updated. So, add an [!UpdateMeasure "MeasureRun"] bang after each !SetOption bang of the mentioned options:
Code: Select all
[MeasurePower]
...
IfTrueAction=[!SetOption MeasureRun Parameter "POWERCFG /SETACTIVE 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c"][!UpdateMeasure "MeasureRun"][!CommandMeasure "MeasureRun" "Run"]
IfCondition2=(#CURRENTSECTION#=1)
IfTrueAction2=[!SetOption MeasureRun Parameter "POWERCFG /SETACTIVE 381b4222-f694-41f0-9685-ff5bb260df2e"][!UpdateMeasure "MeasureRun"][!CommandMeasure "MeasureRun" "Run"]
IfCondition3=(#CURRENTSECTION#=2)
IfTrueAction3=[!SetOption MeasureRun Parameter "POWERCFG /SETACTIVE a1841308-3541-4fab-bc81-f71556f20b4a"][!UpdateMeasure "MeasureRun"][!CommandMeasure "MeasureRun" "Run"]