It is currently April 20th, 2024, 12:00 pm

Update skin after closing a program

Get help with creating, editing & fixing problems with skins
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Update skin after closing a program

Post by jsmorley »

P.S. Another reasonable alternative to an external application is:

https://forum.rainmeter.net/viewtopic.php?t=26884
User avatar
LazieWouters
Posts: 61
Joined: August 29th, 2021, 11:11 am

Re: Update skin after closing a program

Post by LazieWouters »

death.crafter wrote: October 9th, 2021, 12:49 pm A few options:
  • Since you are making an executable in C#, here is a trick, use temporary variables.

    Take in two arguments,
    • Path to Rainmeter
    • A bang with temporary variables, e.g. $color$
    Now in your button event handler you can do,

    Code: Select all

    Process rainmeter = newProcess();
    rainmeter.StartInfo.FileName = args[0];
    rainmeter.StartInfo.Arguments = args[1].Replace("$color$", yourColorVar.ToString());
    rainmeter.Start();
    
    But here, you have to use #CURRENTCONFIG# or ConfigName parameter with every bang where it is applicable. But it will be dynamic, e.g. you are not limited to variables and free to update and redraw.

    Example usage:

    Code: Select all

    [Variables]
    ColorChangeBang = [!SetVariable ThisColor \"$color$\" \"CURRENTCONFIG\"][!WriteKeyValue Variables ThisColor \"$color$\" \"#CURRENTPATH##CURRENTFILE#\"][!Update \"#CURRENTCONFIG#\"]
    [SomeMeter]
    ...
    LeftMouseUpAction = ["#@#myColorPicker.exe" "#PROGRAMPATH#Rainmeter.exe" "#ColorChangeBang#"]
    
    Notice the usage of \" here as you have to escape literal double quotes.
  • Use RainRGB by jsmorley. But personally, I wouldn't suggest it because sometimes av's flag it as malware or something as it is made using autohotkey.
  • Use rainmeter color pickers. You can find them in Share your creations section.
    Speaking of which I got a chance to advertise my skin :twisted:
    ColorPickerUI
I didn't know jsmorley had made this color picker with the rainmeter https://forum.rainmeter.net/viewtopic.php?t=26884
...wow, it's very good, really awesome... I'm analyzing how it was done now, maybe I'll use it with some modifications
User avatar
LazieWouters
Posts: 61
Joined: August 29th, 2021, 11:11 am

Re: Update skin after closing a program

Post by LazieWouters »

jsmorley wrote: October 9th, 2021, 1:19 pm P.S. Another reasonable alternative to an external application is:

https://forum.rainmeter.net/viewtopic.php?t=26884
Yea, I just downloaded it and I'm seeing how you made it... very good!!!!!.... I think I'd better use the one you made, because there really is a risk that AVs will think the .exe file is a virus and block it
User avatar
LazieWouters
Posts: 61
Joined: August 29th, 2021, 11:11 am

Re: Update skin after closing a program

Post by LazieWouters »

Well, I'll do it as follows, I'll give the executable file a try first, because it's only 6KB... and I'll make the file available for testing soon, to see how it behaves... I think , like jsmorley, as it is something that will be used eventually and not all the time, it shouldn't cause any problems... but let's see, I'll make the updated skin available and wait for the feedback from those who use it.
User avatar
LazieWouters
Posts: 61
Joined: August 29th, 2021, 11:11 am

Re: Update skin after closing a program

Post by LazieWouters »

Now in your button event handler you can do,

Code: Select all

Process rainmeter = newProcess();
rainmeter.StartInfo.FileName = args[0];
rainmeter.StartInfo.Arguments = args[1].Replace("$color$", yourColorVar.ToString());
rainmeter.Start();
But here, you have to use #CURRENTCONFIG# or ConfigName parameter with every bang where it is applicable. But it will be dynamic, e.g. you are not limited to variables and free to update and redraw.

Example usage:

Code: Select all

[Variables]
ColorChangeBang = [!SetVariable ThisColor \"$color$\" \"CURRENTCONFIG\"][!WriteKeyValue Variables ThisColor \"$color$\" \"#CURRENTPATH##CURRENTFILE#\"][!Update \"#CURRENTCONFIG#\"]
[SomeMeter]
...
LeftMouseUpAction = ["#@#myColorPicker.exe" "#PROGRAMPATH#Rainmeter.exe" "#ColorChangeBang#"]
Just now I saw your tip... I'm going to adapt the executable code.
User avatar
death.crafter
Rainmeter Sage
Posts: 1399
Joined: April 24th, 2021, 8:13 pm

Re: Update skin after closing a program

Post by death.crafter »

LazieWouters wrote: October 9th, 2021, 1:29 pm Yea, I just downloaded it and I'm seeing how you made it... very good!!!!!.... I think I'd better use the one you made, because there really is a risk that AVs will think the .exe file is a virus and block it
https://github.com/deathcrafter/ColorPickerUI

In case you missed this :D
from the Realm of Death
User avatar
LazieWouters
Posts: 61
Joined: August 29th, 2021, 11:11 am

Re: Update skin after closing a program

Post by LazieWouters »

death.crafter wrote: October 9th, 2021, 5:58 pm https://github.com/deathcrafter/ColorPickerUI

In case you missed this :D
Guys, you really are the masters of Rainmeter!
I'll download your skin too, I'll definitely learn a lot of new stuff.
Thanks!