It is currently March 29th, 2024, 5:33 am

[SUGGESTION] Expand Group bangs

Report bugs with the Rainmeter application and suggest features.
User avatar
Yincognito
Rainmeter Sage
Posts: 7029
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

[SUGGESTION] Expand Group bangs

Post by Yincognito »

Normally, all individual bangs should have a group equivalent, but I'll give just two examples: !ActivateConfigGroup and !MoveMeterGroup.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
SilverAzide
Rainmeter Sage
Posts: 2588
Joined: March 23rd, 2015, 5:26 pm

Re: [SUGGESTION] Expand Group bangs

Post by SilverAzide »

Yincognito wrote: May 27th, 2023, 3:42 pm Normally, all individual bangs should have a group equivalent, but I'll give just two examples: !ActivateConfigGroup and !MoveMeterGroup.
I don't see how an !ActivateConfigGroup could be implemented. You'd need to pass it the name of every config in the group, or have Rainmeter pre-load every installed config at startup to check for the group they belong to, since Rainmeter doesn't know what configs are in a group unless they are loaded.
Gadgets Wiki GitHub More Gadgets...
User avatar
Yincognito
Rainmeter Sage
Posts: 7029
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: [SUGGESTION] Expand Group bangs

Post by Yincognito »

SilverAzide wrote: May 27th, 2023, 4:01 pm I don't see how an !ActivateConfigGroup could be implemented. You'd need to pass it the name of every config in the group, or have Rainmeter pre-load every installed config at startup to check for the group they belong to, since Rainmeter doesn't know what configs are in a group unless they are loaded.
The manual says that "skin groups are defined under the [Rainmeter] section of a skin or the individual [ConfigName] sections of Rainmeter.ini". The former makes more sense from an individual config point of view, while the latter would be more practical in this case and represent one way to implement it (not sure if there's a connection between the two, internally, so I assume the contrary). The drawback would be that the said configs should be activated at least once, so the Group option can have a value for the configs, but then, this might be solved at skin installation time (either the writing of Group options to Rainmeter.ini if needed, or letting the user manually activate them as he wishes as part of his new skin testing process). As for which config variant should be activated, since the Active option in Rainmeter.ini can't be used because it's made 0 once the config is deactivated, one way to achieve it would be to have a LastActive option that can tell which variant was active the last time, if any (if not, could internally default to 0 or 1 and be the first variant in the folder, as there is a precedent in some other case I don't momentarily recall). Then, you'd load the said variant.

The same is with potential obstacles in the hypothetical move meter group bang. There is a precedent, the Container meter - it would be a matter of changing the anchor position, so to speak. A move meter group bang to 19,23 applied to two meters with X=15,Y=52 and X=47,Y=89 would move them to X=19+15,Y=23+52 and X=19+47,Y=23+89, respectively, similar to how relative positioning works (moving meters to overlap one another doesn't make much sense, although there could be cases where one wants that). This can be currently done in Rainmeter by moving the first meter from a relatively positioned set (or using dynamic variables and meter coordinates), but it could have a place in the group bangs too (won't require setting DynamicVariables=1 in the latter case, for example).
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: [SUGGESTION] Expand Group bangs

Post by balala »

SilverAzide wrote: May 27th, 2023, 4:01 pm I don't see how an !ActivateConfigGroup could be implemented.
And I don't see a way to implement !MoveMeterGroup, because the !MoveMeter bang requires two parameters: the horizontal and the vertical position of the meter. But what parameters should have to be added to a !MoveMeterGroup bang? The position of which meter of the group? If the meters of the group are positioned relatively, there is no need of a !MoveMeterGroup bang: moving the first element of the group, all relativelly positioned meters move altogether. If they are positioned absolutely, how can be given the position of all meters belonging to the group?
User avatar
Yincognito
Rainmeter Sage
Posts: 7029
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: [SUGGESTION] Expand Group bangs

Post by Yincognito »

balala wrote: May 27th, 2023, 8:10 pm And I don't see a way to implement !MoveMeterGroup, because the !MoveMeter bang requires two parameters: the horizontal and the vertical position of the meter. But what parameters should have to be added to a !MoveMeterGroup bang? The position of which meter of the group? If the meters of the group are positioned relatively, there is no need of a !MoveMeterGroup bang: moving the first element of the group, all relativelly positioned meters move altogether. If they are positioned absolutely, how can be given the position of all meters belonging to the group?
I already covered that above: the group of meters will move like a unit, in a relativistic way in relation to the anchor's position (aka the bang parameters). It would make no sense to give the position of all meters in the group, for that there is individual positioning. Relying on the existing relative positioning forces that prerequisite to perform the mass movement (i.e. if at some point you want it off, you won't be able to mass move meters), while the existence of a move meter group bang would come with no pre-condition, it could be applied at will, irrespective of the existing positioning.

Anyway, there are obstacles in the case of every suggestion. The focus should not be on them though, but on the advantages of a possible implementation, if they exist.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: [SUGGESTION] Expand Group bangs

Post by balala »

Yincognito wrote: May 28th, 2023, 10:21 am I already covered that above: the group of meters will move like a unit, in a relativistic way in relation to the anchor's position (aka the bang parameters). It would make no sense to give the position of all meters in the group, for that there is individual positioning. Relying on the existing relative positioning forces that prerequisite to perform the mass movement (i.e. if at some point you want it off, you won't be able to mass move meters), while the existence of a move meter group bang would come with no pre-condition, it could be applied at will, irrespective of the existing positioning.

Anyway, there are obstacles in the case of every suggestion. The focus should not be on them though, but on the advantages of a possible implementation, if they exist.
Alright, let's see what a dev says about your idea.
david16s
Posts: 2
Joined: July 13th, 2023, 8:04 am

Re: [SUGGESTION] Expand Group bangs

Post by david16s »

Define a group with [Group] in your skin's .ini file.
Use !CommandMeasure with the measure name to trigger actions on all meters in the group.
Execute desired actions, such as changing values or hiding/showing, by referencing the measure name or meter variable name.
User avatar
Yincognito
Rainmeter Sage
Posts: 7029
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: [SUGGESTION] Expand Group bangs

Post by Yincognito »

Thanks, david16s, but I believe you might be confusing how some of the things you mentioned work. I appreciate your input and willingness to help though. ;-)
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth