It is currently September 21st, 2020, 12:45 pm

Any sort of Region function in the .ini files?

General topics related to Rainmeter.
vandey
Posts: 14
Joined: June 28th, 2013, 1:53 pm

Any sort of Region function in the .ini files?

Post by vandey »

So I'm curious if there's any way to group a set of items together in the .ini skin files. In C# you can just say #region Region Name and it will allow you to collapse all the items inside the region until you give it #endregion. So for example I have a skin that uses a ton of measures for gathering CPU usages, temps and other data. Is there a way to get all the measures for CPU to collapse down so I can have a cleaner feel when editing/creating my skins. I use Notepad++ for editing so it does allow me to collapse each individual measure and meter, but I haven't found a way to collapse a large section.
User avatar
jsmorley
Developer
Posts: 21376
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Any sort of Region function in the .ini files?

Post by jsmorley »

vandey wrote: August 11th, 2020, 1:19 pm So I'm curious if there's any way to group a set of items together in the .ini skin files. In C# you can just say #region Region Name and it will allow you to collapse all the items inside the region until you give it #endregion. So for example I have a skin that uses a ton of measures for gathering CPU usages, temps and other data. Is there a way to get all the measures for CPU to collapse down so I can have a cleaner feel when editing/creating my skins. I use Notepad++ for editing so it does allow me to collapse each individual measure and meter, but I haven't found a way to collapse a large section.
No. The .ini file format is pretty simple and straightforward. It's really not designed or intended as a full-featured programming language format. It's original intent was as a "settings" file, to be read by some application as a way to define options. If we had a wayback machine, and could do it all over, that would not be the file format that would have ever been chosen for Rainmeter.
vandey
Posts: 14
Joined: June 28th, 2013, 1:53 pm

Re: Any sort of Region function in the .ini files?

Post by vandey »

Alright, thanks I was hopeful for some sort of way to do this as my skin files contain a ton of data, it'd be easier to maintain separately or if there was a way to group sections together. In any case, thanks!
vandey
Posts: 14
Joined: June 28th, 2013, 1:53 pm

Re: Any sort of Region function in the .ini files?

Post by vandey »

Suppose there's no way to have measures in one "skin" file and have another "skin" file to reference that?
User avatar
jsmorley
Developer
Posts: 21376
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Any sort of Region function in the .ini files?

Post by jsmorley »

vandey wrote: August 11th, 2020, 1:39 pm Suppose there's no way to have measures in one "skin" file and have another "skin" file to reference that?
Sure, that's easy.

@Include=#CURRENTPATH#myMeasures.inc

https://docs.rainmeter.net/manual/skins/include-option/
https://docs.rainmeter.net/tips/include-guide/

Just put that @Include .inc file wherever you want the measures to functionally be in your skin .ini file.
vandey
Posts: 14
Joined: June 28th, 2013, 1:53 pm

Re: Any sort of Region function in the .ini files?

Post by vandey »

Thanks that will actually help a ton! Just being able to move the measures to a different file will help, as I'll be able to split the different sections of measures up into different files.
User avatar
jsmorley
Developer
Posts: 21376
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Any sort of Region function in the .ini files?

Post by jsmorley »

vandey wrote: August 11th, 2020, 2:02 pm Thanks that will actually help a ton! Just being able to move the measures to a different file will help, as I'll be able to split the different sections of measures up into different files.
Glad to help. At its most extreme, you could do this:

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

@IncludeMyVariables=#CURRENTPATH#myVariables.inc

@IncludeMySystemMeasures=#CURRENTPATH#mySystemMeasures.inc

@IncludeMyNetworkMeasures=#CURRENTPATH#myNetworkMeasures.inc

@IncludeMyClockMeasures=#CURRENTPATH#myClockMeasures.inc

@IncludeMySystemMeters=#CURRENTPATH#mySystemMeters.inc

@IncludeMyNetworkMeters=#CURRENTPATH#myNetworkMeters.inc

@IncludeMyClockMeters=#CURRENTPATH#myClockMeters.inc
vandey
Posts: 14
Joined: June 28th, 2013, 1:53 pm

Re: Any sort of Region function in the .ini files?

Post by vandey »

Yeah I see I can write each one individually then including the meters as well in those .inc files... I might attempt to do that instead so each section is independent. We'll see, I'm not sure I want to get too carried away with it, but it will definitely help clean up the file a bit.