It is currently March 28th, 2024, 8:15 am

Skin Load/Unload Via Bat File

Get help with installing and using Rainmeter.
User avatar
SilverAzide
Rainmeter Sage
Posts: 2588
Joined: March 23rd, 2015, 5:26 pm
Contact:

Re: Skin Load/Unload Via Bat File

Post by SilverAzide »

MourningStar wrote: August 14th, 2021, 10:23 pm Ah, correct - that is why nothing happened. Now it work as per these 'conditions'.

Understood - i.e. the variants are 'locked' into this process because of the required 'configname' parameter.

still, not what I'm after. Looking to 'load'/'unload' the specific skin (and the variant on display at the time).

So, not possible to do what I need? If I am not clear perhaps I can re-word the op.
It is definitely possible, I think you might have misunderstood, so I apologize if I wasn't clear. The !DeactivateConfig band will deactivate any variant of a skin (the exact config name is not a parameter). So, for example, to deactivate any variant of the wireless meter, you use:

Code: Select all

"C:\Program Files\Rainmeter\Rainmeter.exe" !DeactivateConfig "Gadgets\Wireless Meter"
To activate a specific variant, use:

Code: Select all

"C:\Program Files\Rainmeter\Rainmeter.exe" !ActivateConfig "Gadgets\Wireless Meter" "Wireless Meter.ini"
If you are trying to deactivate only a specific variant from a set and not any others, there isn't a way to do it with the command-line. For example, if for some reason you wanted to deactivate the Wireless Meter but not the Wireless Meter Pro variant if it was loaded instead, then it isn't possible. Also doesn't make a whole lot of sense, anyway. (You can use the ConfigActive plug-in to detect the exact variant that is active if you need that level of granularity, but that means you need to put together a skin to do it.)

From your initial post, it seems like you wanted to activate and deactivate skins via batch files that you bound to some keys. If so, then this is definitely possible. Your "turn on wifi" batch file would 1) run the command to turn on your wireless connection and 2) run Rainmeter with the !ActiveConfig bang to load the Wireless Meter. Your "turn off wifi" batch file would do the reverse: 1) run the Rainmeter command to deactivate the Wireless Meter (whichever one is running), then 2) turn off your wireless connection.

Perhaps if you posted your batch files it would help?
User avatar
MourningStar
Posts: 287
Joined: June 12th, 2016, 2:40 am

Re: Skin Load/Unload Via Bat File

Post by MourningStar »

^
That is perfect and resolves the op 99.9%!!!

What is the 0.1%? :

I currently have 21 variants (1 for each animation) to 'that' weather skin y'all helped me with. Activate always loads the first variant in the list. Activate does remember the font and font color, but does not remember the variant or skin size or desktop position(???maybe???).

fwiw - 99.9 is good, VERY good ...
:thumbup: :great: :thumbup:
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Skin Load/Unload Via Bat File

Post by jsmorley »

The way !ActivateConfig works with variants is more nuanced, but in a way that only matters if you don't specify the optional "file" parameter to define the particular skin .ini file you want.

The way it works is that when you specify just a "config" as the only paramter of !ActivateConfig, is the following:

- If no skin is currently loaded from that config, it will load the first (alphabetically) skin .ini file (variant) in that config.
- If a skin is already loaded from that config, it will load the next (alphabetically) skin .ini file (variant) in that config. This will close the skin that was already running. When the last skin (variant) in the config is loaded, the next call will circle back and load the first.
- If a skin is already loaded from that config, and there is only one .ini file (one variant) in the config, then nothing will happen.

If you have a config with mulitple variants in it, you might want to always use the "skin" parameter on !ActivateConfig, so you have more certain control of which variant is loaded. If you specify the skin, that, and only that, will be loaded.

!ActivateConfig has nothing to do with fonts or colors or skin size (??) or skin position. Those are controlled by the skin for fonts and colors and Rainmeter.ini will remember where a config (skin) was positioned the last time it was loaded. I stress "config" here, as if there are variants in a config folder, Rainmeter.ini will remember where the "config" was positioned on the screen. If you load a different variant, it will be positioned at the same spot, which may or may not work well with your skin(s). If two variants are of a different enough size or shape that they can't share a common X and Y position saved for the [ConfigName] in Rainmeter.ini, then they should probably be in two different configs and not treated as "variants".
User avatar
MourningStar
Posts: 287
Joined: June 12th, 2016, 2:40 am

Re: Skin Load/Unload Via Bat File

Post by MourningStar »

jsmorley wrote: August 15th, 2021, 1:45 am... If you have a config with mulitple variants in it, you might want to always use the "skin" parameter on !ActivateConfig, so you have more certain control of which variant is loaded. ...
I must violently agree! Did and done. Thank you and ...

Image
- 100% -
User avatar
SilverAzide
Rainmeter Sage
Posts: 2588
Joined: March 23rd, 2015, 5:26 pm
Contact:

Re: Skin Load/Unload Via Bat File

Post by SilverAzide »

MourningStar wrote: August 15th, 2021, 12:42 am That is perfect and resolves the op 99.9%!!!

What is the 0.1%? :

I currently have 21 variants (1 for each animation) to 'that' weather skin y'all helped me with. Activate always loads the first variant in the list. Activate does remember the font and font color, but does not remember the variant or skin size or desktop position(???maybe???).
Glad you got it working!

This is more of a continuation topic for your weather skin thread, but I can't imagine why you need 21 variant skins for the animations? This seems like a prime candidate for consolidating into a single skin that adjusts its appearance based on some variables. That way you have a single skin that "knows" what it should look like, so whenever you activate it, it's exactly where and how you left it. ...Just a thought!
User avatar
MourningStar
Posts: 287
Joined: June 12th, 2016, 2:40 am

Re: Skin Load/Unload Via Bat File

Post by MourningStar »

SilverAzide wrote: August 15th, 2021, 4:11 am Glad you got it working!

This is more of a continuation topic for your weather skin thread, but I can't imagine why you need 21 variant skins for the animations? This seems like a prime candidate for consolidating into a single skin that adjusts its appearance based on some variables. That way you have a single skin that "knows" what it should look like, so whenever you activate it, it's exactly where and how you left it. ...Just a thought!
A good thought, -thx!

So, my weather skin is not a single skin? Each of my 21 ini files are considered individual skins? Hmmmmm, ... ok. However, being one with a juvenile Rainmeter skillset I did it this way from learning that multi-variants (i.e. the 'Variants' menu pick that appear when one brings up the skin's main menu) are how other skins I use are coded. I notice a few of your own gadgets have variants. Perhaps I do not understand the intended 'purpose' or proper use of the 'Variants' option. This works perfect for me, but I am always game for anything 'new and improved'.

Maybe you or someone can point me to a skin that achieves your 'single-skin' suggestion.

(IMO & FWIW, I do not really feel this topic is in anyway relative, much less a continuation to my weather skin thread)
:Whistle
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Skin Load/Unload Via Bat File

Post by jsmorley »

MourningStar wrote: August 15th, 2021, 3:48 pm So, my weather skin is not a single skin? Each of my 21 ini files are considered individual skins? Hmmmmm, ... ok. However, being one with a juvenile Rainmeter skillset I did it this way from learning that multi-variants (i.e. the 'Variants' menu pick that appear when one brings up the skin's main menu) are how other skins I use are coded. I notice a few of your own gadgets have variants. Perhaps I do not understand the intended 'purpose' or proper use of the 'Variants' option. This works perfect for me, but I am always game for anything 'new and improved'.
As far as "variants" go, to be honest I'd probably tend to stay away from them. The original intent was to support for example a "clock" that you have that has a "light" and "dark" variant. However, this was created long before we had a lot of the clever ways to transform a single skin using all kinds of !WriteKeyValue and !SetOption and Inline Setting and all that, which in my view is probably a better, if somewhat more complex, way to support that. The idea of having two entirely different skins just based on some differences in cosmetics (or a URL, or pretty much anything else really) and having to maintain both of them as I improve and change things does't really appeal to me much.

Even something a bit more complex like two versions of a weather skin, one with 3 days and one with 7 days, can be done in a single skin with a little thought.

I don't doubt there are some good examples of when "variants" is the right way to go. You would need to do a bit of mental "cost-benefit analysis". I can't think of any off the top of my head.
User avatar
MourningStar
Posts: 287
Joined: June 12th, 2016, 2:40 am

Re: Skin Load/Unload Via Bat File

Post by MourningStar »

jsmorley wrote: August 15th, 2021, 3:55 pm As far as "variants" go, to be honest I'd probably tend to stay away from them. The original intent was to support for example a "clock" that you have that has a "light" and "dark" variant. However, this was created long before we had a lot of the clever ways to transform a single skin using all kinds of !WriteKeyValue and !SetOption and Inline Setting and all that, which in my view is probably a better, if somewhat more complex, way to support that. The idea of having two entirely different skins just based on some differences in cosmetics (or a URL, or pretty much anything else really) and having to maintain both of them as I improve and change things does't really appeal to me much.

Even something a bit more complex like two versions of a weather skin, one with 3 days and one with 7 days, can be done in a single skin with a little thought.

I don't doubt there are some good examples of when "variants" is the right way to go. You would need to do a bit of mental "cost-benefit analysis". I can't think of any off the top of my head.
we are somewhat off-topic, but that's sop ( :D ) on most forums I frequent. Anyways this is it, I like it, no impact on my resources, willing to consider other options :
Attachments
2021-08-15_090914.png
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Skin Load/Unload Via Bat File

Post by jsmorley »

Your variant approach is fine, with the understanding that you won't ever be able to load two or more of them at the same time.
User avatar
MourningStar
Posts: 287
Joined: June 12th, 2016, 2:40 am

Re: Skin Load/Unload Via Bat File

Post by MourningStar »

jsmorley wrote: August 15th, 2021, 4:20 pm Your variant approach is fine,
Thank you
jsmorley wrote: August 15th, 2021, 4:20 pm... with the understanding that you won't ever be able to load two or more of them at the same time.
1 - I did not know this was even possible. I have the gadgets weather meter and it has 2 variants (std & Pro). I do not know what to do to display them both. If possible, why would I want to?

2 - As far as my skin is concerned, I know of no rational reason for having more than one displayed.

3 - Perhaps someone can inform me to a scenario where displaying more than one version of the same skin would be logical.

(yay! 200th post, do I get a prize?)
Post Reply