Anatomy of a Skin

Rainmeter works by running "skins", which are .ini files with Rainmeter statements, organized in "configs", which are Windows folders allowing related skins to be grouped together.

Configs and skins are located by default at:
Windows XP: C:\Documents and Settings\YourName\My Documents\Rainmeter\Skins
Windows Vista & Win7: C:\Users\YourName\My Documents\Rainmeter\Skins

So a common location for a skin might be:
C:\Users\YourName\My Documents\Rainmeter\Skins\MyClockSkin\Clock.ini

A Rainmeter .ini "skin" file is a plain text file. It can be edited with any text editor, the most common being Notepad, which comes with Windows, or other more powerful text editors such as: Notepad++. Word processors such as Microsoft Word or WordPad or other WYSIWYG editors are NOT recommended for editing .ini files, and can cause issues by embedding formatting codes you may not even see.

The format of a .ini file is simple. It consists basically of:
[Sections]
Section headings enclosed in square brackets

Key=Value
Key / Value pairs telling Rainmeter to set the "Key" equal to the "Value"

;Comment
Comments, which start with a semi-colon.

There are several sections / section types which most Rainmeter skins will have:

[Rainmeter]
[Metadata]
[Variables]
[Measures]
[Meters]

We will look at the contents of each type of section below:

[Rainmeter]

This section is used to set global settings for a skin. Common items are the name of the author, the date the skin was revised on, how often the skin should be "updated" and perhaps global mouse actions.

[Rainmeter] Author=Jeffrey Morley Update=1000

Update
One important statement in the [Rainmeter] section is the "Update=" command. This tells Rainmeter how often to run the "Measures" in a skin. If a skin is measuring network traffic and displaying a histogram, you may want to measure this every second. If it is checking your GMail account for new messages, it is more common to check only once every few minutes.

"Update" is set in milliseconds (or 1000th of a second). By default, the setting is "1000" which means all measures will update once a second. So for instance to have the skin only update measures every 10 minutes, you would set this to 10 minutes X 60 seconds X 1000 milliseconds or "Update=600000" This will set the update rate for all measures in your skin. A better method is to leave Update= at 1000 and control individual measures using the "UpdateDivider" and "UpdateRate" statements, which we will cover under "Measures".

Just be aware that too low (often) an update rate for many measures can really put a load on your CPU or network, and could be seen as an "attack" if you are checking a web site on the internet.

[Metadata]

This section contains information about the skin itself. Alone, metadata is useful as a consistent and reliable place to learn about a skin, and how it is meant to be used and configured. In addition, addons like RainBrowser can take advantage of metadata to enable more sophisticated skin management features.

It is important for all metadata to be written in the [Metadata] section using a specific set of keys. A template is provided below. If you are editing or creating a skin, you should provide appropriate values for all of these keys.

[Metadata] Name=Title | Subtitle Config=Root Skin Folder | Subfolders | Current Folder Description=Point 1 | Point 2 | Point 3 Instructions=Point 1 | Point 2 | Point 3 Version= Tags=Tag 1 | Tag 2 | Tag 3 License= Variant= Preview=
Example:

[Metadata] Name=Enigma Clock | Big Clock Config=Enigma | Sidebar | Clock Description=Large analog clock with the date and your location. Instructions=Set your Weather Code to show your location. Version=2.6 Tags=Time | Sidebar | Yahoo! Weather License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0 Preview=#SKINSPATH#Enigma\Resources\Images\Preview.png

[Variables]

The Variables section is used to set "aliases" for items you wish to use over and over in your skin so you don't have to type them in full repeatedly, or to define items (like the URL to a website) so they can be easily found and changed by others using your skin.

Variables take the form:
VariableName=Value

The variable is then referred to later in measures and meters as:
#VariableName#

So to set a variable for the size of the font you want to use on all your meters, you might use:
FontSize=11

Then in every meter displaying text, you could set the parameter:
FontSize=#FontSize#

All the meters will use the font size of "11", and they can ALL be easily changed to another size by changing just the variable, rather than changing each individual meter.

Variables can be used to define folders and executables for later use in commands performing some "action"
PathToWinamp="C:\Program Files\Winamp\Winamp.exe"

They can also be used to set the URL for use in WebParser measures reading from the internet.
GoogleNewsURL="http://news.google.com/rss"

[Measures]

Measures are the functional guts of Rainmeter. These are used to measure system statistics, time and date, gather information from web sites, read text files and much more.

The built-in measures available in Rainmeter are:

  • CPU - Measures total load from all CPUs (Use the PerfMon plugin if you want separate the CPUs)
  • Memory - Measures overall memory utilization
  • PhysicalMemory - Measures allocated physical memory
  • SwapMemory - Measures allocated swap
  • NetIn - Measures incoming network traffic
  • NetOut - Measures outgoing network traffic
  • NetTotal - Measures total network traffic
  • FreeDiskSpace - Measures free diskspace
  • PerfMon - Gets NT's performance data
  • Uptime - Shows how long your computer has been on. This works only in a STRING-meter
  • Plugin - Measure is defined by an external plugin
  • Registry - Measures registry values
  • Time - Measures time and date
  • Calc - Calculates formulas

You can also use a third-party "Plugin" in a measure. More on those in a bit.

The format of a measure is:

[MeasureName]
Measure=TypeOfMeasure
Example: "CPU" or "Memory" from the list above
Parameter=Value
Many measures need parameters to tell them how to behave. For instance you need to tell "FreeDiskSpace" which drive to measure. There can be multiple "Parameter=Value" pairs for each measure. Manual - Measures has full details and all the available parameters for the built-in measures.

Example:

[MeasureCPU] Measure=Plugin Plugin=Perfmon.dll PerfMonObject="Processor" PerfMonInstance=0 PerfMonCounter="% Processor Time" PerfMonDifference=1 InvertMeasure=1 UpdateDivider=2

UpdateDivider
We talked earlier about the "Update" statement in the general [Rainmeter] section. As I said, you may wish to leave this at the default of "1000" and control how often individual measures update. A measure looking at network traffic should update pretty often, while one which returns your CPU name obviously doesn't need to update once a second.

The format for UpdateDivider is:
UpdateDivider=xxx
Where "xxx" is a number you wish to divide (really multiply in a sense) the overall "Update=" statement by. So if you have "Update=1000" in the [Rainmeter] section, and put "UpdateDivider=30" in a given measure, you are telling the measure to update every 1000 milliseconds (1 second) X 30, or every 30 seconds. This is the best way to get the right kind of timing control in a skin with multiple measures doing a variety of work.

Using Plugins

Another kind of meaure uses third-party "Plugins" to do the work. This is a valuable part of the Rainmeter architecture, as if allows Rainmeter to be expanded almost endlessly without constant new versions of the core application.

There are a variety of plugins which install with the standard Rainmeter package:

  • Advanced CPU
  • iTunes
  • MBM5
  • PerfMon
  • Ping
  • Power
  • Quote
  • RecycleManager
  • ResMon
  • Speedfan
  • SysInfo
  • WebParser
  • WiFiStatus
  • Window Message
  • WirelessInfo

The format of a measure using a plugin is similar to any measure, but always uses a couple of standard parameters:
[MeasureName]
Measure=Plugin
Plugin=Plugins\PluginName.dll

There will also be some number of other parameters in the form:
Parameter=Value
These control how the plugin behaves, and will vary from plugin to plugin.

See the full Rainmeter manual at Manual - Plugins for information on what these plugins do and all available parameters for each one.

The WebParser Plugin

One of the commonly used plugins is the "WebParser" plugin. This will allow you to read and "parse" information from a web site on the internet, and use the results in a display meter. WebParser is often used to gather local weather information or display items from an "RSS" feed of a web site like Google News.

The format of a measure using WebParser.dll is similar to any measure, but always uses a couple of standard parameters:
[MeasureName]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url="http://UrlNameToParse.com"
RegExp="(?siU)Regular Expression returning information in StringIndexes you use in Meters"

Other important parameters for WebParser (although not required) are:

Substitute="TextYouDon'tWant":"TextYouDoWant"
This subsitutes text found in the HTML before it is displayed. So for instance you can change "TUESDAY" to "Tuesday" if you want.

UpdateRate="xxx"
This is IDENTICAL to the "UpdateDivider=" used in other measures, to control how often the measure is run / updated. Due to apparently being "consistency-challenged", WebParser.dll decided to go its own way with the name for this parameter, so just be aware that on other measures you will use "UpdateDivider=" and for WebParser measures you will use "UpdateRate=".

Having said that, I can't stress enough that this is an important parameter for WebParser. You DO NOT want to hit a web site once a second, as you will soon enough be seen as a DOS (Denial of Service) attack by the site and your IP address will be banned / blocked from accessing it.

WebParser is one of the more powerful plugins for Rainmeter, but can be one of the most challenging to use.
More information on how to use this plugin can be found at: Manual - WebParser

Example:

[MeasureYahooWeather] Measure=Plugin Plugin=Plugins\WebParser.dll UpdateRate=600 URL=http://weather.yahooapis.com/forecastrss?p=22033&u=f RegExp="(?siU).*- (.*).*(.*)/\*(.*).*(.*).*"

[Meters]

Meters are used to display information in Rainmeter. It may be static text or an image, or the value returned by a measure. Where "measures" are the guts of the "functionality" of Rainmeter, "meters" are the guts of the "output" of the program. Anything you want to display will need to be in a meter.

There are a variety of types of meters, depending on what and how you want to display information:

  • Histogram
  • String
  • Bar
  • Bitmap
  • Image
  • Line
  • Roundline
  • Rotator
  • Button

The format of a meter is:
[MeterName]
Meter=TypeOfMeter (from the list above)
MeasureName=NameOfMeasure (if you want to display the results of a measure in a meter)

Like measures, there are parameters for meters so you can control how the information is displayed. These include fonts, colors, sizes, positions and more.

Parameter=Value

These parameters will vary depending on the type of meter. More information on the parameters for different types of meters can be found at: Manual - Meters

Example:

[MeterWeather] MeasureName=MeasureWeather Meter=STRING X=10 Y=10 FontColor=255,255,255,255 FontFace=Trebuchet MS FontSize=12 StringEffect=NONE StringStyle=BOLD StringAlign=LEFT AntiAlias=1

Using Actions

In addition to the measures to gather information and meters to display things, there are several types of "Action" commands which can be put in either the Rainmeter section, measures or meters. The action statement is followed by the action you wish taken. Some of the action statements you can use are:

  • LeftMouseDownAction
  • MiddleMouseDownAction
  • RightMouseDownAction
  • LeftMouseUpAction
  • MiddleMouseUpAction
  • RightMouseUpAction
  • MouseOverAction
  • MouseLeaveAction
  • OnRefreshAction

And a few which are specifically designed to work with the "Calc" measure type, but which can be used with any measure which returns a number value:

  • IfAboveAction
  • IfBelowAction
  • IfEqualAction

The actions you can take based on these action statements take two forms:

!Bangs

These are built-in commands in Rainmeter which can perform actions like hiding or showing meters, disabling or enabling measures, refreshing, loading or unloading skins and more.

Full details and a list of these !Bangs can be found at: Manual - Bangs.

The format for using a !Bang is:
!RainmeterHideMeter MeterName

So for instance you might have a meter you want to click on and have it hide some other meter:

LeftMouseDownAction=!RainmeterHideMeter MeterName

!Execute

This is a special kind of !bang, which serves two purposes:

Used to run two or more !bangs with the same action statement.
The individual !bangs will be enclosed in brackets "[]"

LeftMouseDownAction=!Execute [!RainmeterHideMeter MeterOneName][!RainmeterHideMeter MeterTwoName]

Used to run an external program
Pass the full path and name of the executable, along with any parameters

LeftMouseDownAction=!Execute ["C:\Windows\Notepad.exe" "MyToDoList.txt"]