It is currently April 18th, 2024, 5:21 pm

[Feature] Combine SetVariable & WriteKeyValue

Report bugs with the Rainmeter application and suggest features.
User avatar
StArL0rd84
Posts: 424
Joined: February 8th, 2015, 10:07 pm
Location: EU, Denmark.

[Feature] Combine SetVariable & WriteKeyValue

Post by StArL0rd84 »

Most of the time when changing a variable it needs to be remembered after the current session, but also be changed "right now".
Not refreshing, but rather just update the depending meter followed by a redraw. And then using DynamicVariables on the meter.

This can result in some VERY long lines of bangs!
I suggest keeping the old bangs, but still adding the new bang.
So in stead of: [!SetVariable App1 "#Path1#"][!WriteKeyValue Variables App1 "#Path1#" "#Var#"]
It could be something like: [!StoreVariable App1 "#Path1#" "#Var#"]

This topic has been discussed in the past elsewhere on this forum but i cannot find the thread.
Was just wondering what the developers thoughts on something like this concept would be in 2019?

And then a bonus question...
It might be more of a niche situation, but could also be quite handy to have a bang that could swap two variables around.
So in stead of: [!SetVariable App1 "#App2#"][!WriteKeyValue Variables App1 "#App2#" "#Var#"][!SetVariable App2 "#App1#"][!WriteKeyValue Variables App2 "#App1#" "#Var#"]
It could be: [!SwapVariable "App1" "App2" "#Var#"]
([mWorkTime] = 1 ? #Work# : ([mEnergyLoss:%] >= 70% ? #Chillmode# : </>))
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: [Feature] Combine SetVariable & WriteKeyValue

Post by jsmorley »

User avatar
Cariboudjan
Posts: 268
Joined: May 12th, 2019, 8:55 am

Re: [Feature] Combine SetVariable & WriteKeyValue

Post by Cariboudjan »

I like the swap variable idea. I don't know where I'd use it, but I like it.
User avatar
StArL0rd84
Posts: 424
Joined: February 8th, 2015, 10:07 pm
Location: EU, Denmark.

Re: [Feature] Combine SetVariable & WriteKeyValue

Post by StArL0rd84 »

Cariboudjan wrote: June 8th, 2019, 11:51 pm I like the swap variable idea. I don't know where I'd use it, but I like it.
One example could be a launcher.
You could then scroll up / down over a listed item and swap the variables for path, name etc between the two.
Can be done with setvariable and writekeyvalue,
But the !swap would be cleaner and easier code to write.
([mWorkTime] = 1 ? #Work# : ([mEnergyLoss:%] >= 70% ? #Chillmode# : </>))