You are on page 1of 6

Editing Skins

If you've reached this page - the final part of Rainmeter 101 - then you're ready to cross the line from skin user to skin author. Every Rainmeter skin is written in a unique programming language, or code, and it is this code that makes Rainmeter special. Unlike the "programming" that you've probably heard of, Rainmeter's code is designed to be easy to learn, as well as completely transparent: you can open up any skin to see exactly how it was made, and even start making your own changes right away. Whether you're writing a brand new skin from scratch, or just changing the color on someone else's fonts, Rainmeter's code is the gateway to its most powerful capabilities. To start editing a skin, right-click it and choose Edit skin in the context menu. (You can also select a skin in the Manager and click the Edit button in the top-right corner.)

The skin is divided into sections. Each section has a name in [brackets]. Under the section name, each line contains a single setting, or key, and the corresponding value.
[SectionName] Key1=Value1 Key2=Value2 Key3=Value3

The file may also include comments, which are indicated by a semicolon (;) at the beginning of the line. Rainmeter ignores anything in a line that has been "commented out". You can use comments to give instructions to other users, or just to leave notes for your own use.
; Rainmeter will ignore anything on this line.

Let's look at the illustro\Clock skin as an example.

[Rainmeter]
Most skins begin with the [Rainmeter] section. This section can sometimes be completely empty - it just needs to exist, in order to tell Rainmeter that the file is a skin. Usually, however, the section includes at least the name of the skin's original author. It may also define the minimum version of Rainmeter required for the skin to work, as well as the update period, which you'll learn about shortly.

[Rainmeter] Author=poiru AppVersion=1003000 Update=1000

[Metadata]
The [Metadata] section is where information about the skin's name, version number, license, description, instructions, and/or credits is stored. These values are shown in the Manager. This section does not affect how the skin functions, but it's important to have it, especially if you plan to distribute your skin to other people.
[Metadata] Name=Clock Description=Displays the current date and time. License=Creative Commons BY-NC-SA 3.0 Version=1.0.0

[Variables]
Variables are values which can be used almost anywhere else in the skin. Variables are often used to define fonts, sizes and colors - things that are used by many different sections, and would be tedious and time-consuming to change one at a time. They're also easy to add and change using automated commands (below). Variable keys can be named almost anything you want, aside from a few built-in variables that Rainmeter reserves for specific pieces of information.
[Variables] fontName=Trebuchet MS textSize=8 colorBar=235,170,0,255 colorText=255,255,255,205

Variables can be referenced in other places using hashes (#), such as #fontName# or #textSize#.

Measures
Measures are one of the two most important kinds of sections. Measures tell Rainmeter to gather, store, and modify certain kinds of information. Whether you need your skin to record the time or date, monitor your CPU usage or hard drive capacity, download an RSS feed, or calculate the phase of the moon, you will use a Measure to manipulate the raw data involved. The Measure key determines which type of measure is being used; the rest of the keys depend on the type. A complete list of measure types can be found in the manual.
[measureTime] Measure=Time Format=%H:%M

Measures are also how skins call upon plugins to expand their capabilities. Use the Plugin key to choose a plugin file. Each plugin, like each measure, has its own set of keys according to its purpose. A list of Rainmeter's stock plugins can be found here. For an example of a plugin, let's look at this WebParser plugin measure from illustro/Feeds, which downloads the latest RSS feed items from Lifehacker:
[measureFeed] Measure=Plugin Plugin=WebParser.dll Url=http://www.google.com/reader/view/feed/#feedURL#?n=8 RegExp="(?siU)<h1>(.*)</h1>.*<div class="item">.*<a href="(.*)">(.*)</a> UpdateRate=1500 StringIndex=1 Substitute="":"N/A"

Meters
Measures are not "physical" parts of the skin; they cannot be seen or clicked. That's what meters are for. Text, images, outlines and backgrounds - as well as bars, graphs, arcs or rotating dials - are all created as meters. The Meter key defines the type of meter being used. If a meter is used to display information from a measure, they are bound together using the MeasureName key.
[meterTitle] Meter=STRING MeterStyle=styleTitle MeasureName=measureTime X=100 Y=12 W=190 H=18 Text="%1"

Styles
Several meters can also share a common set of properties, called styles, which are bound to a meter using the MeterStyle key. This is useful when you want a large group of meters to share a common pattern, such as a list of tabs or bullet points. Styles are usually defined in their own separate sections -as long as theyt don't have either a Meter or a Measure key, Rainmeter will ignore them. However, a meter can also be used as a style by another meter of the same type.
[styleTitle] StringAlign=CENTER StringCase=UPPER StringStyle=BOLD StringEffect=SHADOW FontEffectColor=0,0,0,50

FontColor=#colorText# FontFace=#fontName# FontSize=10 AntiAlias=1 ClipString=1 ; Note the use of the variables "colorText" ; and "fontName" in this style.

Bangs
Bang commands, or "bangs", tell Rainmeter to take some sort of action when triggered. The name comes from the fact that all bang commands begin with the bang (!) symbol. Bangs can be triggered in a number of ways, including when a mouse button is pressed, a measure value meets a certain condition, or when the skin is loaded or refreshed. They can even be sent from an external application. For example, this meter from the [i]illustro\System[/i] skin opens the Windows Task Manager when you click it with your left mouse button:
[meterTitle] Meter=STRING MeterStyle=styleTitle X=100 Y=12 W=190 H=18 Text="System" LeftMouseUpAction=!Execute ["taskmgr.exe"]

Bangs can be used to show, hide or move meters - or even whole skins. They can change the settings on your meters or measures, rewrite variables, launch programs, load or unload skins, change options, play sounds, invoke plugin commands, and - believe it or not - much more. The !Execute bang can even be used to string multiple bangs together. These are one of Rainmeter's most powerful features, and should be used with care. You can see a complete list of Rainmeter's bangs here.

The Update Cycle


Each skin has its own update period, which is the amount of time that passes between one update and the next. The update is the moment when your measures check their data sources for new values, and your meters are "redrawn" to reflect any measure changes or bang commands which affect their appearance. The period is defined by the Update key in the [Rainmeter] section. The default is
[Rainmeter] Update=1000

which gives you a period of 1 second, or 1000 milliseconds. This means that, if you don't limit the frequency, your measures and meters are all updating themselves once per second, every second. This is fine for most skins, but for others, especially those with large graphics or complex formulas, it can be a drag on resources. A higher Update value means that the skin will update less frequently - for example, 10000 would give you a period of 10 seconds between updates. You can also choose to make some measures update less often than the rest of the skin, using the UpdateDivider key.
[measureTime] Measure=Time Format=%H:%M UpdateDivider=3

The UpdateDivider divides the skin's update rate for that measure. So in this example, if the Update is 1000 (1 second), and the measure's UpdateDivider is 3, the measure will only update once every 3 seconds. (The WebParser plugin uses a slightly different key, UpdateRate, which accomplishes the same thing.) When a skin is refreshed, on the other hand, it is not merely updated, but completely reset, as if it had just been loaded. Refreshing will also apply any changes that you have saved to the skin file. You can refresh any skin by right-clicking and selecting Refresh skin. As you spend more time editing Rainmeter skins, the "refresh" command will become a very, very familiar friend.

Conclusion
Now that you're familiar with the basic anatomy of a Rainmeter skin, you should try our tutorials, which will walk you through the process of creating a whole new skin from scratch. Or, if you're feeling more ambitious, feel free to dive right into customizing a skin that you already have. Don't be afraid to experiment! One of the best ways to learn Rainmeter is to tear a skin apart, then build it back up again - especially if you have a specific goal in mind. Along the way, be sure to consult the Manual, which will give you a more complete and technical explanation of all of the features you learned about in this guide. And if you need help, feel free to stop by our forum. We have a large and creative community that is more than happy to help newcomers learn the craft, fix problems with each other's skins, and solve tricky programming puzzles. Good luck!

The Rainmeter Team

Search Rainmeter 101


How It Works Using Rainmeter Adding Skins Editing Skins Skin Tutorials

Hosting provided by Osiris Development. BatteryBar - The most accurate laptop battery meter available.

You might also like