It is currently June 27th, 2019, 11:09 am

How to use command line to initial skins in the ini files?

Help with creating, editing & fixing problems with skins
brainwatcher
Posts: 4
Joined: April 23rd, 2019, 7:04 am

How to use command line to initial skins in the ini files?

brainwatcher » April 23rd, 2019, 7:19 am

Hi everyone,
I am making my own rainmeter skins. Most of them are icons for applications. I make the .ini files for them in command line of powershell under Win10. To initial the skin, I alwalys need to double-click the ini file in the Rainmeter panel. As the application number increasing, it becomes harder for me to select the new ini file in the skinpath. Could you tell me a way to initial loading the skin in command line ? Like bangs? I know I could change the "Active" value in the "rainmeter.ini" file. But that only successes after I have loaded the skin by mouse click previously.
Thank you for your time.
Bests.
Zhang Wei
User avatar
eclectic-tech
Rainmeter Sage
Posts: 3375
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: How to use command line to initial skins in the ini files?

eclectic-tech » April 23rd, 2019, 2:02 pm

brainwatcher wrote:
April 23rd, 2019, 7:19 am
Hi everyone,
I am making my own rainmeter skins. Most of them are icons for applications. I make the .ini files for them in command line of powershell under Win10. To initial the skin, I alwalys need to double-click the ini file in the Rainmeter panel. As the application number increasing, it becomes harder for me to select the new ini file in the skinpath. Could you tell me a way to initial loading the skin in command line ? Like bangs? I know I could change the "Active" value in the "rainmeter.ini" file. But that only successes after I have loaded the skin by mouse click previously.
Thank you for your time.
Bests.
Zhang Wei
After creating a new skin outside of Rainmeter, you need to "!Refresh All" or "!RefreshApp" in order for Rainmeter to "see" the new skin. Note that Bangs can also be used from the Windows command line as a parameter to the Rainmeter.exe executable.
Example: "C:\Program Files\Rainmeter\Rainmeter.exe" !RefreshApp

Then you can use the !ActivateConfig Bang to load the new skin; you will need the "Config" name and the "file" name for use in that bang.
Example: "C:\Program Files\Rainmeter\Rainmeter.exe" !ActivateConfig "illustro\Clock" "Clock.ini"
Or from another Rainmeter skin using just the Bang.
Example: !ActivateConfig "illustro\Clock" "Clock.ini"

That should enable you to add the new skin to Rainmeter and activate it, either from your Windows command line window or inside a Rainmeter skin using Bangs.
User avatar
balala
Rainmeter Sage
Posts: 8320
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How to use command line to initial skins in the ini files?

balala » April 23rd, 2019, 2:44 pm

eclectic-tech wrote:
April 23rd, 2019, 2:02 pm
That should enable you to add the new skin to Rainmeter and activate it, either from your Windows command line window
Yes, but problem is that when you want to load a not loaded skin through this method, you get a message that Rainmeter.ini is read-only. Unfortunately I don't see a way to use this method to load / unload skins (o I am just missing something?), because I suppose while Rainmeter is running, it has control over Rainmeter.ini, where the status of skins are written. You can't modify it "from outside", through a command line.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 3375
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: How to use command line to initial skins in the ini files?

eclectic-tech » April 23rd, 2019, 4:00 pm

balala wrote:
April 23rd, 2019, 2:44 pm
Yes, but problem is that when you want to load a not loaded skin through this method, you get a message that Rainmeter.ini is read-only. Unfortunately I don't see a way to use this method to load / unload skins (o I am just missing something?), because I suppose while Rainmeter is running, it has control over Rainmeter.ini, where the status of skins are written. You can't modify it "from outside", through a command line.
Aargh! You are right. :oops:

Once a new skin is added using "!RefreshApp", it cannot be activated from the command line while Rainmeter is running.
Exit Rainmeter, write the new config as active in rainmeter.ini, restart Rainmeter... so we are "back to square one".

I too don't see a simple way to achieve the OP's desire to activate the newly created skin using bangs. :uhuh:
User avatar
balala
Rainmeter Sage
Posts: 8320
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How to use command line to initial skins in the ini files?

balala » April 23rd, 2019, 4:06 pm

eclectic-tech wrote:
April 23rd, 2019, 4:00 pm
I too don't see a simple way to achieve the OP's desire to activate the newly created skin using bangs. :uhuh:
Activating it using a bang is easy (!ActivateConfig bang). What is hard (and I don't have good tip) is how to activate a skin / config from command line (I suppose this is what you wanted to say, right?).
brainwatcher
Posts: 4
Joined: April 23rd, 2019, 7:04 am

Re: How to use command line to initial skins in the ini files?

brainwatcher » April 23rd, 2019, 4:16 pm

eclectic-tech wrote:
April 23rd, 2019, 2:02 pm
After creating a new skin outside of Rainmeter, you need to "!Refresh All" or "!RefreshApp" in order for Rainmeter to "see" the new skin. Note that Bangs can also be used from the Windows command line as a parameter to the Rainmeter.exe executable.
Example: "C:\Program Files\Rainmeter\Rainmeter.exe" !RefreshApp

Then you can use the !ActivateConfig Bang to load the new skin; you will need the "Config" name and the "file" name for use in that bang.
Example: "C:\Program Files\Rainmeter\Rainmeter.exe" !ActivateConfig "illustro\Clock" "Clock.ini"
Or from another Rainmeter skin using just the Bang.
Example: !ActivateConfig "illustro\Clock" "Clock.ini"

That should enable you to add the new skin to Rainmeter and activate it, either from your Windows command line window or inside a Rainmeter skin using Bangs.
Thank you for your advice! Really helpful! It works well in my powershell script.( $add_name is the new skin name.)

Code: Select all

$x1="!ActivateConfig"
$x2='"'+"illustro\icon\$add_name"+'"'
$x3='"'+"$add_name.ini"+'"'
Start-Process -FilePath "C:\Users\username\Documents\Rainmeter\Skins\Rainmeter.exe" -ArgumentList $x1,$x2,$x3
brainwatcher
Posts: 4
Joined: April 23rd, 2019, 7:04 am

Re: How to use command line to initial skins in the ini files?

brainwatcher » April 23rd, 2019, 4:23 pm

eclectic-tech wrote:
April 23rd, 2019, 4:00 pm
Aargh! You are right. :oops:

Once a new skin is added using "!RefreshApp", it cannot be activated from the command line while Rainmeter is running.
Exit Rainmeter, write the new config as active in rainmeter.ini, restart Rainmeter... so we are "back to square one".

I too don't see a simple way to achieve the OP's desire to activate the newly created skin using bangs. :uhuh:
I don't know the reason for your mentioned problem. I am using powershell. I found no error editing my rainmeter.ini.
brainwatcher
Posts: 4
Joined: April 23rd, 2019, 7:04 am

Re: How to use command line to initial skins in the ini files?

brainwatcher » April 23rd, 2019, 4:26 pm

balala wrote:
April 23rd, 2019, 2:44 pm
Yes, but problem is that when you want to load a not loaded skin through this method, you get a message that Rainmeter.ini is read-only. Unfortunately I don't see a way to use this method to load / unload skins (o I am just missing something?), because I suppose while Rainmeter is running, it has control over Rainmeter.ini, where the status of skins are written. You can't modify it "from outside", through a command line.
I don't know the reason for your mentioned problem. I am using powershell win10-64bit. I found no error editing my rainmeter.ini.
User avatar
balala
Rainmeter Sage
Posts: 8320
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How to use command line to initial skins in the ini files?

balala » April 23rd, 2019, 5:07 pm

brainwatcher wrote:
April 23rd, 2019, 4:26 pm
I don't know the reason for your mentioned problem. I am using powershell win10-64bit. I found no error editing my rainmeter.ini.
Yeah, I didn't test the PowerShell solution, just the plain command line one, which didn't work. If the PowerShell works, use it.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 3375
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: How to use command line to initial skins in the ini files?

eclectic-tech » April 23rd, 2019, 9:03 pm

brainwatcher wrote:
April 23rd, 2019, 4:23 pm
I don't know the reason for your mentioned problem. I am using powershell. I found no error editing my rainmeter.ini.
I commented after trying it in Windows command line (per balala's comment) and having it fail to work.

Good to know it worked in a PowerShell script. :thumbup: