It is currently December 13th, 2018, 2:35 pm

!ActivateConfigGroup Bang?

Report bugs with the Rainmeter application and suggest features.
User avatar
Posts: 50
Joined: November 27th, 2016, 1:51 pm

Re: !ActivateConfigGroup Bang?

theimmersion » November 15th, 2017, 2:07 pm

I know its an old post but im at a position of needing such function myself. Tho, i understand why its not possible to have a activateConfigGroup. At least, it would basically require Rainmeter to check and know all .ini files groups regardless of loaded or unloaded which is not efficient to do at all. It would take a lot of resources, rainmeter needing to read every .ini files and variations etc. Like... nope. xD
Tho, loading layout is the way to go. Essentially, it is very efficient and basiclly the same thing. Except, the user has even an easier way to add and remove skins and save it to a layout. The only problem i have is that it reloads all skins everytime !LoadLayout is called. I would like if there was a bang like !LoadLayoutFade or something (im sure the devs can find a much more appropriate name for the bang) that would actually not reload all the layouts but try and see which ones are already active and if same configs are active, it would just fade in the ones that arent loaded and leave the otherones alone.

Basically, I have a AHK script to switch between skins by category that is being called from a button skin:

The skin just uses buttons with:

Code: Select all

LeftMouseUpAction=["#@#Scene.ahk" Desktop]
LeftMouseUpAction=["#@#Scene.ahk" Game]
LeftMouseUpAction=["#@#Scene.ahk" Work]
and the script would be calling:

Code: Select all

if Desktop
     Run, %RainmeterLoc% !LoadLayoutFade "SCENE_DESKTOP"
if Game
     Run, %RainmeterLoc% !LoadLayoutFade "SCENE_GAME"
if Work
     Run, %RainmeterLoc% !LoadLayoutFade "SCENE_WORK"
But if i would use !LoadLayout, all skins that are being shared on all scenes, like google search and the button skin etc..
would unload and fade back in which just looks aweful.

The only way i found a workaround is to call any specific skin by ![De]ActivateConfig but is not user friendly at all and requires a lot of manual labor to remove or add new skins to it every time and is surly not good for rainmeter as well to get so many instructions. I can imagine problems if pc is under load and a lot of skins need switching. Imagining rainmeter getting a spasm... xD
Like this ahk script:

Code: Select all

if Desktop
     Run, %RainmeterLoc% !DeactivateConfig "Scenes\Game" "Game.ini"
     Run, %RainmeterLoc% !DeactivateConfig "Scenes\Work" "Work.ini"
     Run, %RainmeterLoc% !ActivateConfig "Scenes\Desktop" "Desktop.ini"
if Game
     Run, %RainmeterLoc% !DeactivateConfig "Scenes\Desktop" "Desktop.ini"
     Run, %RainmeterLoc% !DeactivateConfig "Scenes\Work" "Work.ini"
     Run, %RainmeterLoc% !ActivateConfig "Scenes\Game" "Game.ini"
if Work
     Run, %RainmeterLoc% !DeactivateConfig "Scenes\Desktop" "Desktop.ini"
     Run, %RainmeterLoc% !DeactivateConfig "Scenes\Game" "Game.ini"
     Run, %RainmeterLoc% !ActivateConfig "Scenes\Work" "Work.ini"
Can you imagine how someone would edit this script to change/add/remove skins?
Also, to be able to edit, id need to use uncompiled script and require user to install ahk.
Otherwise, i could compile in .exe and it would work without needing additional installs.

It actually has a lot more skins to load and unload, this is just a demo. So, could i ask if its possible for a LoadLayoutFade or whatever bang that would first check if any skins that are about to be unloaded match the new layout and if so, not be unloaded and only new ones added.
So far, anything i asked for was a nope. :D
I actually expect the same answer from jsmorley. :rofl:
I know theres always millions of reasons why not and only my one reason why yes. :oops:

I could use [Rainmeter] Group=Desktop/Game/Work and !ShowFadeGroup !HideFadeGroup but id like to deactivate any skins that arent being used to use as less resources as possible.
Tho, im not sure how Hidden skins behave, do they take up resources and how much. Are calc measures frozen etc...
Like, when you switch to Game, i turn off all the skins that measure CPU/GPU load and temps etc... stuff and show them on Work to monitor PC load while i program stuff etc... Thats the idea anyway.

EDIT: how about SwitchLayout bang name? Sounds good, its short and descriptive enough for logic to tell that LoadLayout means load new and disregard everything else and SwitchLayout would try and load only missing skins. Of course i know its still a very complicated request, if you take in account the skin Z/load order i guess.