It is currently March 28th, 2024, 1:11 pm

Adding ini file to other existed skin.

Get help with creating, editing & fixing problems with skins
antonio0421
Posts: 24
Joined: January 6th, 2021, 7:01 am

Adding ini file to other existed skin.

Post by antonio0421 »

Hi,

I've tried to add the systemColors.ini file from Win10 Widgets to other skins but nothing worked.

Here there systemColors's code:

Code: Select all

[Variables]
WindowsColor=[MeasureWindowsColor]
WindowsColorText=[MeasureWindowsColorText]
WindowsColorDark=[MeasureWindowsColorDark]


; ------------------------------------------------------------------------
; MEASURES
; ------------------------------------------------------------------------

[MeasureColorTrigger]
; Updates Windows accent palette every UpdateDivider*(meter "Update" value) milliseconds.
Measure=String
OnUpdateAction=[!CommandMeasure MeasurePaletteRegistry Run]
UpdateDivider=100

[MeasurePaletteRegistry]
; Returns Windows accent palette.
Measure=Plugin
Plugin=Plugin\RunCommand
Parameter=C:\Windows\System32\reg.exe query HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Accent /v AccentPalette
OutputType=ANSI
FinishAction=[!UpdateMeasure MeasureWindowsColor][!UpdateMeasure MeasureWindowsColorText][!UpdateMeasure MeasureWindowsColorDark]
UpdateDivider=-1

; Palette options:
; "\1\2\3"
; "\5\6\7"	
; "\9\10\11"	Windows accent color for text
; "\13\14\15"	Primary Windows accent color
; "\17\18\19"
; "\21\22\23"	Taskbar color (when it's not black)
; "\25\26\27"	Text input color
; "\29\30\31"

[MeasureWindowsColorText]
; Returns Windows accent color for text.
Measure=String
String=[MeasurePaletteRegistry]
DynamicVariables=1
RegExpSubstitute=1
Substitute="(?siU).*REG_BINARY\s*([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2}).*":"\9\10\11"
UpdateDivider=-1
OnChangeAction=[!UpdateMeterGroup WindowsTextColorGroup]

[MeasureWindowsColorDark]
; Returns dark Windows accent color.
Measure=String
String=[MeasurePaletteRegistry]
DynamicVariables=1
RegExpSubstitute=1
Substitute="(?siU).*REG_BINARY\s*([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2}).*":"\25\26\27"
UpdateDivider=-1
OnChangeAction=[!UpdateMeterGroup WindowsDarkColorGroup]

[MeasureWindowsColor]
; Returns primary Windows accent color.
Measure=String
String=[MeasurePaletteRegistry]
DynamicVariables=1
RegExpSubstitute=1
Substitute="(?siU).*REG_BINARY\s*([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2}).*":"\13\14\15"
UpdateDivider=-1
OnChangeAction=[!UpdateMeterGroup WindowsColorGroup]
Here the task.ini I testing:

Code: Select all

; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
; DEVELOPER OPTIONS
; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

;------------------------------------ 

[Rainmeter]
Author=T-Skins | Tanjil Ahmed
ContextTitle="Stepris Config"
ContextAction=["#@#\Variables\config.exe"]

[Metadata]
Information=Task Manager Launcher
License=Creative Commons BY-NC-SA 3.0
Version=1.2

[Variables]
@include=#@#Variables\Variables.inc
@include2=#@#Variables\systemColors.ini

ImgPath=#@#Images\
AppPath=#TaskManagerPath#

[Hover]
Meter=Image
ImageName=#ImgPath#circle
W=60
H=60
ImageAlpha=30
Hidden=1

[Circle]
Meter=Image
ImageName=#ImgPath#circle
ImageTint=#WindowsColor#
W=50
H=50
X=5
Y=5
LeftMouseUpAction=["#AppPath#"]
AntiAlias=1

[Icon]
Meter=Image
ImageName=#ImgPath#task
X=r
Y=r
AntiAlias=1
I changed WindowsColor from systemColors to a RGB code, the color of task.ini changed.
Otherwise, it's turn white when I reset the WindowsColor to original while my windows color was gray.
I've added DynamicVariables=1 to task.ini still not worked.

ie. how to test or debug a ini or inc file? I using notepad++.
Last edited by antonio0421 on January 11th, 2021, 2:05 am, edited 3 times in total.
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Adding ini file to other existed skin.

Post by balala »

Try adding a [!SetVariable WindowsColor "[MeasureWindowsColor]"] bang to the OnChangeAction option of the [MeasureWindowsColor] measure. Beside this, I'd add a [!Redraw] as well to the same option: OnChangeAction=[!UpdateMeterGroup WindowsColorGroup][!SetVariable WindowsColor "[MeasureWindowsColor]"][!Redraw].
Also add a DyanmicVariables=1 option to the [Circle] meter in the task.ini file, otherwise the meter can't use the dynamically set variable.
antonio0421
Posts: 24
Joined: January 6th, 2021, 7:01 am

Re: Adding ini file to other existed skin.

Post by antonio0421 »

balala wrote: January 6th, 2021, 9:34 am Try adding a [!SetVariable WindowsColor "[MeasureWindowsColor]"] bang to the OnChangeAction option of the [MeasureWindowsColor] measure. Beside this, I'd add a [!Redraw] as well to the same option: OnChangeAction=[!UpdateMeterGroup WindowsColorGroup][!SetVariable WindowsColor "[MeasureWindowsColor]"][!Redraw].
Also add a DyanmicVariables=1 option to the [Circle] meter in the task.ini file, otherwise the meter can't use the dynamically set variable.
Thank you! It's worked.

But I wonder why the original ones worked without added these code?
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Adding ini file to other existed skin.

Post by balala »

antonio0421 wrote: January 6th, 2021, 11:55 am Thank you! It's worked.
I'm glad it does. :thumbup:
antonio0421 wrote: January 6th, 2021, 11:55 am But I wonder why the original ones worked without added these code?
What do you mean by "why the original ones worked"? I thought it didn't:
antonio0421 wrote: January 6th, 2021, 7:12 am I've tried to add the systemColors.ini file from Win10 Widgets to other skins but nothing worked.
antonio0421
Posts: 24
Joined: January 6th, 2021, 7:01 am

Re: Adding ini file to other existed skin.

Post by antonio0421 »

balala wrote: January 6th, 2021, 4:41 pm I'm glad it does. :thumbup:

What do you mean by "why the original ones worked"? I thought it didn't:
Sorry my bad english, I mean it was worked for Win10 widget skins, this is the source of the systemcolor.ini I've coppied.
However, it worked now so I can rest in peace. :thumbup:

May I can ask one more question? That is how can I test or debug my ini or inc file to make sure it will work properly?
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Adding ini file to other existed skin.

Post by balala »

antonio0421 wrote: January 7th, 2021, 3:14 am However, it worked now so I can rest in peace. :thumbup:
Please, don't rest (neither in peace, nor other way). :great:
antonio0421 wrote: January 7th, 2021, 3:14 am May I can ask one more question? That is how can I test or debug my ini or inc file to make sure it will work properly?
For first load the skin in Rainmeter and see if it does work. If it does, there is nothing to debug. What have you to do if it doesn't, depends. If you don't know what to do, the simplest is to post a question here on forum, to get a solution. After a while, if you keep working, you'll realize you can debug more and more complex skins. Just keep working.
antonio0421
Posts: 24
Joined: January 6th, 2021, 7:01 am

Re: Adding ini file to other existed skin.

Post by antonio0421 »

balala wrote: January 7th, 2021, 4:50 pm Please, don't rest (neither in peace, nor other way). :great:
You're right, I don't rest, yet.
Here another issue. It's seem "InlineSetting" code don't understand my systemcolor as you can see the image below:
Image
The "17M" "Recycle bin" "32 items" supposed to be red as same as the windows color, but it not. :???:
balala wrote: January 7th, 2021, 4:50 pm For first load the skin in Rainmeter and see if it does work. If it does, there is nothing to debug. What have you to do if it doesn't, depends. If you don't know what to do, the simplest is to post a question here on forum, to get a solution. After a while, if you keep working, you'll realize you can debug more and more complex skins. Just keep working.
My code knowledge is zero so not sure if my stuff worked properly :great:
Attachments
屏幕截图 2021-01-08 165417.png
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Adding ini file to other existed skin.

Post by balala »

antonio0421 wrote: January 8th, 2021, 10:15 am Here another issue. It's seem "InlineSetting" code don't understand my systemcolor as you can see the image below:
Image
The "17M" "Recycle bin" "32 items" supposed to be red as same as the windows color, but it not. :???:
Have no idea what are you talking about. In the original code poested by you, there is no InlineSetting. In fact the original code has nothing to do with the posted images, as far as I can tell, looking to them.
But if you want to get red everything in the string meter(s), can't you simply use a FontColor=255,0,0 option on them?
antonio0421
Posts: 24
Joined: January 6th, 2021, 7:01 am

Re: Adding ini file to other existed skin.

Post by antonio0421 »

balala wrote: January 8th, 2021, 4:51 pm Have no idea what are you talking about. In the original code poested by you, there is no InlineSetting. In fact the original code has nothing to do with the posted images, as far as I can tell, looking to them.
But if you want to get red everything in the string meter(s), can't you simply use a FontColor=255,0,0 option on them?
Sorry my bad, I mean those skin used a variable based on SystemColor.ini as below.

Code: Select all

StringAlign=LeftCenter
InlineSetting=Face | #Font#
InlineSetting2=Weight | 100
InlineSetting3=Size | (32*#Scale#)
InlineSetting4=Color | #WindowsColor#
InlineSetting5=Shadow | 1 | 1 | 1 | 0,0,0,100
AntiAlias=1
#WindowsColor# was the variable from SystemColor.ini I've used for that skin which is named "recycle bin.ini" the color are #5E6D80

Here's the variables from SystemColor.ini

Code: Select all

[Variables]
WindowsColor=[MeasureWindowsColor]
WindowsColorText=[MeasureWindowsColorText]
WindowsColorDark=[MeasureWindowsColorDark]
But if I change [MeasureWindowsColor] to any hex code as code below, it's worked.
[Variables]
WindowsColor=FF0000
WindowsColorText=[MeasureWindowsColorText]
WindowsColorDark=[MeasureWindowsColorDark]
Conclusion: InlineSetting4=Color don't understand [MeasureWindowsColor]

Another ways I've tried to:
- Change InlineSetting4=Color to FontColor => Worked, but the texts are screwed.
- Convert [MeasureWindowsColor] to RGB code and vice versa => not worked.
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Adding ini file to other existed skin.

Post by balala »

antonio0421 wrote: January 9th, 2021, 4:11 am Conclusion: InlineSetting4=Color don't understand [MeasureWindowsColor]

Another ways I've tried to:
- Change InlineSetting4=Color to FontColor => Worked, but the texts are screwed.
- Convert [MeasureWindowsColor] to RGB code and vice versa => not worked.
Have you added the OnChangeAction option to the [MeasureWindowsColor] measure, as suggested before? Make sure it is there.
Also make sure the meter which has the posted InlineSettings, has a DynamicVariables=1 option added as well.
Another thing you have to take care about is the hexadecimal colors. Make sure not to add a leading hash # character. I see you didn't add it into the last quote, but it is added previously
antonio0421 wrote: January 9th, 2021, 4:11 am #WindowsColor# was the variable from SystemColor.ini I've used for that skin which is named "recycle bin.ini" the color are #5E6D80
so make sure it isn't there.
Post Reply