Skins: New @Resources folder

Changes made during the Rainmeter 2.5 beta cycle and earlier.
User avatar

Skins: New @Resources folder

May 20th, 2012, 7:34 pm
jsmorley
Developer   [16413 posts]

As the first step in a re-design of how .rmskins are created and installed in Rainmeter, we are changing how resources like fonts, addons, images, sounds, include files and other things used by your skin are handled by Rainmeter. This change will also completely eliminate the need for the LocalFont setting in skins.

The key to this functionality is support for a new @Resources folder under the root level of the skin suite (e.g. Skins\illustro\@Resources).

  • Any font files found under @Resources\Fonts will automatically be loaded and available in the skin. There will be no need to use LocalFont in [Rainmeter], and there should seldom if ever be any reason to distribute a skin with the .rmskin configured to install the font to the user's system. Just put the font in the correct folder in the skin and you are done.
  • Any files, such as addons, images, sounds, include files or any other resources your skin uses should be kept in this folder, and then can be accessed with a new #@# variable, which expands to #ROOTCONFIGPATH#@Resources\.

    For example, use:

    Code: Select all

    ImageName=#@#Images\MyImage.png
    @Include=#@#Settings.inc

    Instead of:

    Code: Select all

    ImageName=#ROOTCONFIGPATH#@Resources\Images\MyImage.png
    @Include=#ROOTCONFIGPATH#@Resources\Settings.inc

  • The @Resources folder is ignored when scanning for skins. Keeping images and other common files there will speed up the load time of Rainmeter.

In future skins, you should use @Resources in your skins. It is going to be best to store resources (such as images, addons, fonts, etc.) there.
User avatar

Re: Skins: New @Resources folder

May 21st, 2012, 8:47 am
XANCI
   [106 posts]

seems @\ to #ROOTCONFIGPATH#@Resources\ can't be used in !WriteKeyValue to designate target .ini/.inc file

Re: Skins: New @Resources folder

May 21st, 2012, 8:55 am
poiru
Developer   [2876 posts]

XANCI wrote:seems @\ to #ROOTCONFIGPATH#@Resources\ can't be used in !WriteKeyValue to designate target .ini/.inc file

Fixed it for the next release. Thanks for reporting! :)
User avatar

Re: Skins: New @Resources folder

May 21st, 2012, 11:44 am
jsmorley
Developer   [16413 posts]

We have changed @\ to #@# be both behave exactly as any variable replacement does, and to make it more consistent. Be sure to get the latest r1395 beta at http://rainmeter.net.
User avatar

Re: Skins: New @Resources folder

May 23rd, 2012, 2:20 pm
XANCI
   [106 posts]

should or should not Lua files be placed in @Resources?
User avatar

Re: Skins: New @Resources folder

May 23rd, 2012, 2:23 pm
jsmorley
Developer   [16413 posts]

XANCI wrote:should or should not Lua files be placed in @Resources?


That is entirely up to you. I don't, so I end up with @Resources folder, SkinName.ini and LuaName.lua in the root of my skin folder. I do it that way mostly as I like to be able to get at the .lua files to edit them without having to dig for them, but it is just personal preference. I think the perfectionist approach would probably be to put just the .ini file in the root, and everything else in @Resources.
User avatar

Re: Skins: New @Resources folder

June 20th, 2012, 7:58 pm
MarcoPixel
   [28 posts]

Im a little bit confused about that new folder. How can i use plugins which NEEDS to be installed in #AddonsPath#?

Can we maybe get an example skin with Variables, Addons and Themes?

Greets,
Marco
User avatar

Re: Skins: New @Resources folder

June 22nd, 2012, 10:19 am
jsmorley
Developer   [16413 posts]

MarcoPixel wrote:Im a little bit confused about that new folder. How can i use plugins which NEEDS to be installed in #AddonsPath#?

Can we maybe get an example skin with Variables, Addons and Themes?

Greets,
Marco


The way this will work from here out is that you should try to make your skins as "self-contained" as possible. The simplest and most reliable way is to use the new @Resources folder to store and access supporting files for your skins.

This is one recommended approach. There is nothing that says you have to do it exactly this way, but in my opinion it makes it easier to distribute your skins, and easier to manage them yourself.

Images, sounds and Lua scripts:

These should be kept in their own folders in the @Resources folder. So you would have YourSkinFolder\@Resources\Images, and access it with ImageName=#@#Images\SomeImage.png in an Image meter.

Fonts:

These should be kept in a folder in your skin specifically called @Resources\Fonts. The folder names above are just a suggestion, but with fonts it needs this specific name. If you put a font .ttf file in this folder, it will automatically be loaded by Rainmeter and available to use with FontFace=MyFont in your skin. Do NOT use LocalFont in the [Rainmeter] section of your skin any more, it just isn't needed.

Addons:

Executable addons should also be kept in the @Resources folder with your skin. I recommend using YourSkinFolder\@Resources\Addons. Then you can call the addon with LeftMouseUpAction=[#@#Addons\MyAddon.exe "Some Parameter"]. Please note that you will want to contain the call to external applications inside square brackets "[]". Please completely avoid the use of #ADDONSPATH# at all. It is no longer needed, and only supported for backwards compatibility with older skins.

If you have an existing adddon written specifically for Rainmeter that REQUIRES that it be in a folder relative to Rainmeter.exe (a few addons baked in "..\..\Rainmeter.exe" assuming that they were in the old C:\Program Files\Rainmeter\Addons\MyAddon\MyAddon.exe location) then you will need to manually move it to C:\Users\YourName\Appdata\Roaming\Rainmeter\Addons and use #ADDONSPATH# to call it. This should be avoided at all costs, as it is then very difficult to distribute your skin. The Addons specific path is no longer available when you create a .rmskin, and only supported at all so older skins don't break.

Custom Plugins:

If you are using or distributing a custom plugin .dll file with your skin, it must be kept in C:\Users\YourName\Appdata\Roaming\Rainmeter\Plugins. Any plugin .dll found in that folder when Rainmeter starts will be loaded and available to use with your skins by simply using Plugin=MyPlugin.dll on your measure. These plugins can be added to a .rmskin when you create it, but be aware that you need both 32bit and 64bit versions of the plugin to add it to a .rmskin. We don't want folks distributing skins that are crippled when used on a different operating system architecture.

Themes:

There is really no change to how themes are managed. You use the Themes tab in the Manage application from the context menu, and save a theme with your current layout. Then when you create a .rmskin you simply add the theme to the file, and it will be installed (and optionally loaded) when the user runs the .rmskin.

I hope this helps.
User avatar

Re: Skins: New @Resources folder

June 24th, 2012, 2:31 pm
Seahorse
   [1220 posts]

jsmorley wrote:Custom Plugins:

If you are using or distributing a custom plugin .dll file with your skin, it must be kept in C:\Users\YourName\Appdata\Roaming\Rainmeter\Plugins. Any plugin .dll found in that folder when Rainmeter starts will be loaded and available to use with your skins by simply using Plugin=MyPlugin.dll on your measure. These plugins can be added to a .rmskin when you create it, but be aware that you need both 32bit and 64bit versions of the plugin to add it to a .rmskin. We don't want folks distributing skins that are crippled when used on a different operating system architecture.


OK, so is this the right location for plugins in the skin folder for plugins?:

YourSkinFolder\@Resources\Plugins\64Bit
&
YourSkinFolder\@Resources\Plugins\32Bit
User avatar

Re: Skins: New @Resources folder

June 24th, 2012, 2:35 pm
jsmorley
Developer   [16413 posts]

Seahorse wrote:
jsmorley wrote:Custom Plugins:

If you are using or distributing a custom plugin .dll file with your skin, it must be kept in C:\Users\YourName\Appdata\Roaming\Rainmeter\Plugins. Any plugin .dll found in that folder when Rainmeter starts will be loaded and available to use with your skins by simply using Plugin=MyPlugin.dll on your measure. These plugins can be added to a .rmskin when you create it, but be aware that you need both 32bit and 64bit versions of the plugin to add it to a .rmskin. We don't want folks distributing skins that are crippled when used on a different operating system architecture.


OK, so is this the right location for plugins in the skin folder for plugins?:

YourSkinFolder\@Resources\Plugins\64Bit
&
YourSkinFolder\@Resources\Plugins\32Bit


No sir.

Plugins go in:

C:\Users\YourName\AppData\Roaming\Rainmeter\Plugins

When you add them to a .rmskin, they can be added from anywhere. Then when the .rmskin is installed by the user, the correct (32bit or 64bit) version ONLY will be installed to that folder in APPDATA.

Return to “Rainmeter 2.5”



Who is online

Users browsing this forum: No registered users and 1 guest