It is currently April 27th, 2024, 11:02 am

[Feature Request] Variable to access IniFile

Report bugs with the Rainmeter application and suggest features.
User avatar
Jeff
Posts: 332
Joined: September 3rd, 2018, 11:18 am

[Feature Request] Variable to access IniFile

Post by Jeff »

Hello, I'll just start by saying this is most likely not an issue in the grand scheme of things, it's really just pointing something that is missing from the built-in variables that MIGHT be a non sequitur problem once in a blue moon.

Currently I'm making a skin where I'm reading the Rainmeter Setting File to get the the section names and weather that section is Active or not.

Code: Select all

[SettingsFileStuff]
Measure      =WebParser
URL          =file://#SETTINGSPATH#Rainmeter.ini
This code works for it, it just gets the Setting Path, appends Rainmeter.ini and bam we got the setting file.

My only though is, what do I do with users who have lunched Rainmeter using a custom IniFile?
For those who don't know, if you close Rainmeter, make a file named haha.ini on your desktop and drag that file over the Rainmeter executable, you will see in the About > Version tab that the IniFile is indeed the file you drag and dropped from the desktop, if for some reason you run Rainmeter like this, my #SETTINGSPATH#Rainmeter.ini will not work here.

I'm pretty sure no one on Earth, the Moon or Mars is using Rainmeter like this, for me it's just an "eh, I'll just let my code be like this, I know it works for 100% of the people that try it anyways". Rainmeter.exe !Bangs assume Rainmeter is running and dose its actions only on the very first opened one, RestartRainmeter.exe however initializez Rainmeter assuming Rainmeter.ini, so I'm doing the exact same thing as it. If this really was a problem, it would have been brought up a long time ago when RestartRainmeter.exe was introduced.

I'm just wondering since I ran into this and I'm curious, is there anything to do? Plugins can get the """"""""Setting File"""""""""... or maybe not, when I first read that line I was so happy, but then I read what it dose and then read it again because I thought I read it wrong, I laughed a bit and yeah there's where I'm at rn.
User avatar
Yincognito
Rainmeter Sage
Posts: 7175
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: [Feature Request] Variable to access IniFile

Post by Yincognito »

Jeff wrote: February 6th, 2024, 9:23 pmFor those who don't know, if you close Rainmeter, make a file named haha.ini on your desktop and drag that file over the Rainmeter executable, you will see in the About > Version tab that the IniFile is indeed the file you drag and dropped from the desktop, if for some reason you run Rainmeter like this, my #SETTINGSPATH#Rainmeter.ini will not work here.
Wow, didn't know that! It's not just that though, if you drag such an .ini to the Rainmeter executable while you're still running Rainmeter, several Rainmeter files and folders (see the bottom Explorer window) will be copied to the folder where you dragged that .ini from (in this case, to the Desktop folder), and visually, your existing Layout (for me, my skin suite's one, visible at the top of the screenshot) will be "merged" with the Layout in the dragged .ini (in my case, I just renamed the Illustro's Rainmeter.ini to be my haha.ini file, just to limit the potential "damage"), because there will be two Rainmeter executables running (see the notification area at the bottom right of the screenshot):
haha.jpg
Not sure about what this feature is supposed to do, but my guess is that it's probably something related to the ability to alternatvely use Rainmeter as a portable application - at least that's how it looks like.

I'll have to clean up the results of this experiment, but it was fun seeing what can be done once in a while. As for getting the "Rainmeter.ini" actual name (like "haha.ini", in this case), it looks like a legit feature to have. I'll add one more, less important, but since we're at it: the #CURRENTFILE# name, but without the dot or the extension. I know one can easily have a String measure and remove the ".ini" part in a Substitute, but in some cases it might be useful to have just the name and nothing else, so we can quickly append the desired extension to it (e.g. image extensions for skin icons, .inc extensions for configurations corresponding to the current skin, etc).

P.S. I'm sure you know it already, but if you need an alternative way to find whether a skin is active, you can use ConfigActive too, you don't have to rely exclusively on parsing the "Rainmeter.ini" file. It'd be interesting to know if the plugin works with the "haha.ini" tricks as well, though I don't see why not.
You do not have the required permissions to view the files attached to this post.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Jeff
Posts: 332
Joined: September 3rd, 2018, 11:18 am

Re: [Feature Request] Variable to access IniFile

Post by Jeff »

Yincognito wrote: February 6th, 2024, 11:01 pm Not sure about what this feature is supposed to do, but my guess is that it's probably something related to the ability to alternatvely use Rainmeter as a portable application - at least that's how it looks like.
!LoadLayout didn't exist when this feature was created/used
Yincognito wrote: February 6th, 2024, 11:01 pm P.S. I'm sure you know it already, but if you need an alternative way to find whether a skin is active, you can use ConfigActive too, you don't have to rely exclusively on parsing the "Rainmeter.ini" file.
I used it in another skin I made but the thing I'm working on requires more than that, I just have to nuke my Uni to finish it faster.
User avatar
Yincognito
Rainmeter Sage
Posts: 7175
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: [Feature Request] Variable to access IniFile

Post by Yincognito »

Jeff wrote: February 8th, 2024, 3:07 pm !LoadLayout didn't exist when this feature was created/used


I used it in another skin I made but the thing I'm working on requires more than that, I just have to nuke my Uni to finish it faster.
Ah, I see. Well, there are at least three methods to do what you want. Use either a RunCommand, a FileView or a Lua [IniFile] measure to "filter" and get the name of the (presumably) sole .ini residing in the #SETTINGSPATH# folder, then use URL=file://#SETTINGSPATH#[&IniFile] and DynamicVariables=1 in your WebParser to parse that .ini the usual way. A bit redundant, but it should work.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth