It is currently April 26th, 2024, 10:11 am

Sauver une mesure dans une variable - Save a measure in a variable

Get help with creating, editing & fixing problems with skins
User avatar
NoWay_To_HeaVeN
Posts: 42
Joined: December 19th, 2011, 12:28 pm
Location: FR

Re: Sauver une mesure dans une variable - Save a measure in a variable

Post by NoWay_To_HeaVeN »

balala wrote: January 19th, 2021, 4:56 pm I'm sorry, but I can't follow:
Don't worry about looking for anymore, Balala :oops:
I just saw with horror that the variable # SCREENAREAWIDTH @ n # does not always (often?) return the right value :jawdrop ,
so I will go back to the code to work on the trick you gave me for the number of active monitors.

OnUpdateAction = [! SetVariable ScreenWidthX "[MeasureScreenWidthX]"] [! WriteKeyValue "Variables" "ScreenWidthX" "[MeasureScreenWidthX]"]
Which returns the correct values

One question however, am I right if I say that:
-!SetVariable is applied in real time
-!WriteKeyValue is saved, but not applied until the next refresh?
Setvariable allowing me to update the current resolutions live, and WriteKeyValue, to find them at the next launch.

I will also try to centralize the variables much more, and the "functions" (less simple for this second) O.O .
If you allow me, I will come back to you to possibly check the code, and optimize it if possible ... :oops:
But not tomorrow I think ;-)
Windows 10 Pro 64-bit (build 19042) / AMD Ryzen 9 3900X / RAM 16 Go / GTX960-4Go X 2
Rainmeter :4.4.0.3412 beta 64-bit (Dec 28 2020)
User avatar
balala
Rainmeter Sage
Posts: 16172
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Sauver une mesure dans une variable - Save a measure in a variable

Post by balala »

NoWay_To_HeaVeN wrote: January 20th, 2021, 1:39 pm I just saw with horror that the variable # SCREENAREAWIDTH @ n # does not always (often?) return the right value :jawdrop ,
The monitor variables are dynamic, so a DynamicVariables=1 option is required on meters / measures where they are used. Make sure you have added it.
NoWay_To_HeaVeN wrote: January 20th, 2021, 1:39 pm One question however, am I right if I say that:
-!SetVariable is applied in real time
-!WriteKeyValue is saved, but not applied until the next refresh?
Setvariable allowing me to update the current resolutions live, and WriteKeyValue, to find them at the next launch.
Right.
NoWay_To_HeaVeN wrote: January 20th, 2021, 1:39 pm If you allow me, I will come back to you to possibly check the code, and optimize it if possible ... :oops:
Ok, however due to the single monitor I have, it might be a little bit difficult.
User avatar
NoWay_To_HeaVeN
Posts: 42
Joined: December 19th, 2011, 12:28 pm
Location: FR

Re: Sauver une mesure dans une variable - Save a measure in a variable

Post by NoWay_To_HeaVeN »

balala wrote: January 20th, 2021, 6:32 pm The monitor variables are dynamic, so a DynamicVariables=1 option is required on meters / measures where they are used. Make sure you have added it.

Right.

Ok, however due to the single monitor I have, it might be a little bit difficult.
Yes, I had set DynamicVariables=1
But I don't know why, when windows can't find a screen at the requested value, it reverts to a previous value ... well, I think so.
Anyway, with the mandatory complete overhaul (due to my special setup), I could test again.

I restart from scratch almost,
And barely started, I need help ;-)
How can I retrieve a variable in rainmeter.ini?
(I would like to be able to save the "WindowX" in a variable)

[RSP_interface \ Miscellaneous \ Wallpaper3 \ ScreenPos]
Active = 0
WindowX = 1920 <<


If it's possible...
I explain why my wallpaper manager was causing problems (even, and probably especially with a single monitor).
My primary monitor is between 3 "secondary" monitors
s4 | s3 | Primary | s2
I therefore had to modulate with positive and negative values.
Everything was fine as long as all the monitors were the same resolution, and it didn't have to be ported to different resolutions, but after my old Samsung 22 "died I used an Acer 20" , which immediately made me understand the problem of placement ...

Suddenly, to come back to my request to recover a value of the rainmeter.ini, I am thinking of making an anchor to place the wallpapers at will without too much hassle.
Yes, placing the wallpapers directly would be easier ... but this system I think allows you to set the anchor in posX 0 and PosY 0

Thanks for all the help, and in advance thanks for the help coming ;-)
Windows 10 Pro 64-bit (build 19042) / AMD Ryzen 9 3900X / RAM 16 Go / GTX960-4Go X 2
Rainmeter :4.4.0.3412 beta 64-bit (Dec 28 2020)
User avatar
balala
Rainmeter Sage
Posts: 16172
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Sauver une mesure dans une variable - Save a measure in a variable

Post by balala »

NoWay_To_HeaVeN wrote: January 20th, 2021, 9:40 pm How can I retrieve a variable in rainmeter.ini?
(I would like to be able to save the "WindowX" in a variable)
Not sure what do you mean by "retrieve", but such a variable does exist: that's the #CURRENTCONFIGX#. You can use it freely, just make sure to add a DynamicVariables=1 option to any measure / meter which want to use it dynamically. For instance see the following measure:

Code: Select all

[MeasureX]
Measure=Calc
Formula=#CURRENTCONFIGX#
This measure is always returning the current horizontal positiion of the current skin, but if you move manually the skin, you don't get the measure updated. If you add a DynamicVariables=1 option to the above measure, the measure will always return the coordinate of the skin, dynamically (if you move the skin, the measure immediattely gets the new and correct value).
Is this what you meant?
User avatar
NoWay_To_HeaVeN
Posts: 42
Joined: December 19th, 2011, 12:28 pm
Location: FR

Re: Sauver une mesure dans une variable - Save a measure in a variable

Post by NoWay_To_HeaVeN »

balala wrote: January 21st, 2021, 4:35 pm Not sure what do you mean by "retrieve", but such a variable does exist: that's the #CURRENTCONFIGX#. You can use it freely, just make sure to add a DynamicVariables=1 option to any measure / meter which want to use it dynamically. For instance see the following measure:

Code: Select all

[MeasureX]
Measure=Calc
Formula=#CURRENTCONFIGX#
This measure is always returning the current horizontal positiion of the current skin, but if you move manually the skin, you don't get the measure updated. If you add a DynamicVariables=1 option to the above measure, the measure will always return the coordinate of the skin, dynamically (if you move the skin, the measure immediattely gets the new and correct value).
Is this what you meant?
Yes !
Perfect !
Thank's
Windows 10 Pro 64-bit (build 19042) / AMD Ryzen 9 3900X / RAM 16 Go / GTX960-4Go X 2
Rainmeter :4.4.0.3412 beta 64-bit (Dec 28 2020)
User avatar
balala
Rainmeter Sage
Posts: 16172
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Sauver une mesure dans une variable - Save a measure in a variable

Post by balala »

NoWay_To_HeaVeN wrote: January 21st, 2021, 7:39 pm Yes !
Perfect !
Thank's
You're welcome. :thumbup: