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] |
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 |
Number options
Number options require either a number or a formula.
; The following lines are equivalent: |
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: |
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: |
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: |
External Windows Commands
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] |
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 |
There are other instances where embedded characters like [
or (
in a parameter of a bang might cause Rainmeter to improperly detect the beginning of a [SectionVariable] or (formula) and become confused. Magic Quotes can help with this as well. All characters between """Magic Quotes""" are treated strictly literal.
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.
#*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# |
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
- Beginners tutorial for regular expressions
- Advanced tutorial for regular expressions
- Cheat sheet for PCRE regular expressions
- Online tool for testing PCRE regular expressions
Help with regular expressions in WebParser
- Manual entry for WebParser
- WebParser Tutorial
- Using lookahead assertions in WebParser
- Guide for debugging regular expressions in WebParser
- RainRegExp addon for testing WebParser RegExp options.
Information on the RSS and ATOM feed standards