Option Types


In the most basic sense, a skin in Rainmeter is controlled by a .ini file consisting of sections, options, and option values.

[SectionName]
OptionName=OptionValue

The skin can have various kinds of sections. These include:

  • [Rainmeter]
  • [Metadata]
  • [Variables]
  • [MeasureName]
  • [MeterName]

These sections can have many options and option values. Some of which are general in nature, and some of which are very specific to the type of section, for instance specific options for the various measure, plugin or meter types.

While the options used can be general or specific, the options will fall into one of the following broad type categories:

String options

String options require a text value.

Text=Hello World
MyVar=Hello World

Number options

Number options require either a number or a formula.

; The following lines are equivalent:
FontSize=42
FontSize=(40 + 2)
FontSize=(2 > 1 ? 42 : 666)

Path options

Path options specify the relative or absolute path of either a file or a folder (depending on the option). For example, the path and name of an image file is expected with ImageName.

There are built-in variables provided that automatically resolve to paths for the Rainmeter application or individual skins. These are described at Path Variables and Skin Variables.

In addition, there is a built-in variable #@# that resolves to the @Resources folder in the root config folder of the current skin.

; Paths relative to the current skin folder:
ImageName=lolcat.png
ImageName=..\lolcat.png

; Absolute path:
ImageName=C:\lolcats\lolcat.png

; Path to the current skin folder:
ImageName=#CURRENTPATH#lolcat.png

; Path to the @Resources\Images folder under the root config of the current skin:
ImageName=#@#Images\lolcat.png

Color options

Color options such as SolidColor and FontColor should use the RGBA (red-green-blue-alpha) notation in either the hexadecimal or decimal form. The color results from a mixing of the red, green and blue components of the option, with the transparency (alpha channel) of the element set by the fourth component.

Decimal colors are specified as RRR,GGG,BBB,AAA, where RRR, GGG, BBB, and AAA are decimal numbers from 0 to 255. Formulas can also be used in place of the numbers.

Hexadecimal colors are specified as RRGGBBAA, where RR, GG, BB, and AA are hexadecimal numbers from 00 to FF.

Note: The alpha component is optional. As with the other components it is a value from 0 to 255 (00 to FF), with 0 being completely invisible (and the meter will not react to the mouse) to 255, which is completely opaque. The default is 255 (or FF). To have a element be "invisible" while still reacting to the mouse, use an alpha value of 1.

; The following lines are equivalent to solid opaque red:
SolidColor=255,0,0,255
SolidColor=255,0,0
SolidColor=(200 + 55),(2 - 2),0
SolidColor=FF0000FF
SolidColor=FF0000

Action options

Options in a skin which cause Rainmeter to take some action. Actions may be triggered by user input such as mouse actions or changing values and system events within the skin, such as IfActions or OnUpdateAction.

Normally the value of an action option is going to be one or more bangs, or the execution of external commands in Windows. When multiple bangs are defined on the same action option, enclose them in square brackets [].

; Single bang:
LeftMouseUpAction=!HideMeter SomeMeter
LeftMouseUpAction=[!HideMeter SomeMeter]

; Multiple bangs:
LeftMouseUpAction=[!HideMeter SomeMeter][!HideMeter SomeOtherMeter]

For bangs that take parameters, the arguments should be separated by a space. Parameters that contain spaces must use quotes around the parameter.

; These two lines are equivalent:
LeftMouseUpAction=[!HideMeter SomeMeter]
LeftMouseUpAction=[!HideMeter "SomeMeter"]

; These two are NOT equivalent. The first line will cause an error due to the spaces
; in the parameters while the second will properly set the value of SomeVariable
; to: I think, therefore I am
LeftMouseUpAction=[!SetVariable SomeVariable I think, therefore I am]
LeftMouseUpAction=[!SetVariable SomeVariable "I think, therefore I am"]

; These two may or may not be equivalent depending on the value of the #ImageFile#
; variable. If #ImageFile# contains spaces, the first line will fail. In uncertain
; cases, it is always best to use quotes as in the second line.
LeftMouseUpAction=[!SetWallpaper #ImageFile#]
LeftMouseUpAction=[!SetWallpaper "#ImageFile#"]

External Windows commands can be executed by specifying the path to the executable and any parameters. Enclose the command in square brackets [], and enclose any values with spaces in quotes.

LeftMouseUpAction=["C:\Windows\Notepad.exe" MyFile.txt]
; Runs Notepad.exe and loads the file MyFile.txt.

LeftMouseUpAction=["https://forum.rainmeter.net"]
; Opens the URL in the default web browser.

Magic Quotes

A parameter to a bang that contains embedded quotes should be surrounded by a what we call """magic quotes""". A pair of triple quotes.

; The first line will fail due to extra quotes. The second line will properly log
; Example string: Bob said "hello" to Susan
LeftMouseUpAction=[!Log "Bob said "hello" to Susan"]
LeftMouseUpAction=[!Log """Bob said "hello" to Susan"""]

Escaping a #Variable# or [MeasureName]

When using #VarName# or [MeasureName] in an action option, the current value of the variable or measure will be used. To have the literal string "#VarName#" or "[MeasureName]" used, in a !SetOption value for instance, surround the variable or measure name with asterisk * characters.

For example, use #*VarName*# or [*MeasureName*] to tell Rainmeter to "escape" the variable or measure name. You do not want the value resolved, but rather used as a literal string.

LeftMouseUpAction=!SetOption SomeMeter FontSize #VarName#
; The FontSize option for SomeMeter will be set to the current value of the variable.

LeftMouseUpAction=!SetOption SomeMeter FontSize #*VarName*#
; The FontSize option for SomeMeter will be set to the the string "#VarName#"

LeftMouseUpAction=!SetOption SomeMeter FontSize [MeasureName]
; The FontSize option for SomeMeter will be set to the current value of the measure.

LeftMouseUpAction=!SetOption SomeMeter FontSize [*MeasureName*]
; The FontSize option for SomeMeter will be set to the string "[MeasureName]".

Normal variables

  • #*VarName*#
  • [*MeasureName*]

Nested variables

  • [#*VarName*]
  • [&*MeasureName*]

Regular expression options

These options use Perl Compatible Regular Expressions (PCRE) to match specific parts of a text string. Regular expressions are used when the structure of a piece of data is known, but the content is not.

In Rainmeter, regular expressions are most prominently used by the WebParser plugin to interpret (or "parse") web-based or local text file data sources, but they can also be used to modify the string value of a measure using Substitute options, or to test a string in a measure with IfMatch options.

Resources for regular expressions

Tutorials and guides for regular expressions

Help with regular expressions in WebParser

Information on the RSS and ATOM feed standards