黄道周集:Bangs
Rainmeter can also be controlled with !Bang-commands. A bang is a special command that can be executed to change something in the application. You can use the bangs in the various actions that Rainmeter has, or run from them from the command line by giving it as an argument for Rainmeter.exe.
General Rules
- A single !Bang may be called using:
LeftMouseUpAction=!Refresh
- Multiple !Bangs must be in square brackets preceded by !Execute and a space:
LeftMouseUpAction=!Execute [!ResetStats][!Refresh]
- Executing an external application is done by using the !Execute bang and a space, followed by the command and any parameters inside of square brackets:
LeftMouseUpAction=!Execute ["C:\Windows\Notepad.exe" "FileToOpen.txt"]
- When using special characters (such as a double quote or unmatched square brackets) in a parameter of a bang, use """ (instead of ") to indicate the beginning and end of the parameter. For example, the following will set SomeVariable to A "B" C:
LeftMouseUpAction=!Execute [!SetVariable "SomeVariable" """A "B" C"""]
The following, on the other hand, will result in a error:LeftMouseUpAction=!Execute [!SetVariable "SomeVariable" "A "B" C"]
- Bangs names can be preceded by the "Rainmeter" keyword. For example, !RainmeterShowMeter and !ShowMeter are both treated equally in recent versions of Rainmeter (older versions require that "Rainmeter" is specified).
Bangs
Note that the [] means that you must supply the argument for the bang (do not include the []-chars). The () means that the argument is optional.
Most !bangs take also the config as an optional parameter. If the config is defined the bang only applies to that particular config. If it's not given, the !bang is sent to the current (in a skin) or first (from the command line) config. Use * as the config's name to send it to all configs.
- !Execute
Special !bang that can be used to combine several !bangs together. The !bangs are separated with '[' and ']'-chars. You can also launch applications with this (!Execute ["C:\Windows\Notepad.exe"])
Actions for the Rainmeter application
- !About (TabName)
Opens the About dialog. TabName can be set to Log, Measures, Plugins, or Version. Defaults to Log. - !Manage (TabName)
Opens the Manage dialog. TabName can be set to Skins, Themes, or Settings. Defaults to Skins. - !LsBoxHook [Config]
Special bang for LiteStep lsBox. Note that you MUST give the name of the config as argument. - !ResetStats
Resets the statistics. - !RefreshApp
Does a full refresh of all skins and reloads the list of configs and Rainmeter.ini settings. This is the same as "Refresh All" from the system tray context menu. The main difference from!Refresh *
is that the skins folder is rescanned. - !Quit
Quits Rainmeter. - PLAY [soundfile]
Plays the given .wav soundfile once.
Requires a full path to the .wav file. - PLAYLOOP [soundfile]
Plays the given soundfile as loop.
Requires a full path to the .wav file. - PLAYSTOP
Stops the currently playing sound.
Actions for variables and settings in skins or groups of skins
- !SetOption [Meter/Measure] [Option] [Value] (Config)
Sets an option (e.g. FontSize, Text, Formula, etc.) of a meter or measure.
A more complete guide to using !SetOption is at !SetOption Guide. - !SetOptionGroup [Group] [Option] [Value] (Config)
Sets an option (e.g. FontSize, Text, Formula, etc.) of meters and measures in the specified group. - !WriteKeyValue [Section] [Key] [Value] ("FileSpec")
Allows for permanently writing / changing any Key=Value in any Rainmeter .ini or other ini formatted file such as a .inc @Include file. "Section" is the section name such as [Rainmeter], "Key" and "Value" are the Key=Value pairs such as FontSize=15. "FileSpec" is optional. If included, it will make the change to the specified file as long as the file exists and is in the \Skins or %APPDATA%\Rainmeter paths. Thus, you can write to any skin .ini / .inc or Rainmeter.ini. For a change to a file to take effect, a refresh of the skin (or Rainmeter) is required. - !SetVariable [Variable] [Value] (Config)
Sets a new value for a variable. The meter or measure where the variable is used must have dynamic variables enabled (DynamicVariables=1). Formulas may be used, enclosed in parentheses. As with all !Bangs, quotes must be used around the parameter if there are spaces:!SetVariable VarName "(#SCREENAREAWIDTH# - 10)"
Note: !SetVariable can create a new variable in memory, even if it is not pre-defined in [Variables]. - !SetVariableGroup [Variable] [Value] [Group]
Change the value of a variable in the configs of the specified group.
Actions for a skin or group of skins
- !Show (Config)
Displays the Rainmeter-window. - !Hide (Config)
Hides the Rainmeter-window. - !Toggle (Config)
Toggles the Rainmeter-window between show and hide. - !ToggleGroup [Group]
Toggle the configs in the specified group between show and hide. - !HideGroup [Group]
Hide the configs in the specified group. - !ShowGroup [Group]
Show the configs in the specified group. - !Move [X] [Y] (Config)
Moves the Rainmeter-window to new location. - !ActivateConfig [Config] [Ini-file]
Activates a new configuration ini-file. The ini-file is just the name of the file; do not include the path. - !DeactivateConfig [Config]
Deactivates the configuration ini-file. - !DeactivateConfigGroup [Group]
Deactivate the configs in the specified group. - !ToggleConfig [Config] [Ini-file]
Toggles the configuration ini-file between activated and deactivated. - !Refresh (Config)
Reloads the configuration file. The arguments are optional. If not given the current config is reloaded. The Config and IniFile must exist in the already loaded list of configurations. - !RefreshGroup [Group]
Refresh the configs in the specified group. - !Update (Config)
Causes Rainmeter to immediately update the skin, overriding what is in Update= in the [Rainmeter] Section. Note that this does not override UpdateDivider/UpdateRate on individual measures. - !Redraw (Config)
Forces the redraw of the window. This also updates all the meters. - !RedrawGroup [Group]
Redraw the configs in the specified group. - !SetTransparency [AlphaAmount] (Config)
Sets the transparency of a skin from 0 (invisible) to 255 (opaque). - !SetTransparencyGroup [AlphaAmount] [Group]
Change the transparency of the configs in the specified group. - !ShowFade (Config), !HideFade (Config), !ToggleFade (Config)
Shows or hides the current or specified (Config) skin using a "fade" effect. The speed of the fade is determined by theFadeDuration=
setting for the skin in Rainmeter.ini. - !ShowFadeGroup (Config), !HideFadeGroup (Config), !ToggleFadeGroup (Config)
Shows or hides the current or specified (Config) group using a "fade" effect. The speed of the fade is determined by theFadeDuration=
setting for the skin in Rainmeter.ini. - !HideBlur (Config)
Hides the blur behind skin. - !ShowBlur (Config)
Shows the blur behind skin if it was hidden. - !ToggleBlur (Config)
Toggles the visibility of the blur behind the skin. - !AddBlur [Region] (Config)
Adds blur region to existing blur area. - !RemoveBlur [Region] (Config)
Removes blur region from existing blur area. - !Draggable [NewSetting] (Config)
Sets Draggable setting for current / named / all configs. NewSetting can be 0 (off), 1 (on), or -1 (toggle). - !DraggableGroup [NewSetting] [Group]
Sets Draggable setting for specified group. NewSetting can be 0 (off), 1 (on), or -1 (toggle). - !ZPos [POS] (Config)
Changes the z-position of the window. -2 = OnDesktop, -1 = OnBottom, 0 = Normal, 1 = OnTop, 2 = Topmost. - !ZPosGroup [POS] [Group]
Change the z-position of the configs in the specified group. - !KeepOnScreen [NewSetting] (Config)
Sets KeepOnScreen setting for current / named / all configs. NewSetting can be 0 (off), 1 (on), or -1 (toggle). - !KeepOnScreenGroup [NewSetting] [Group]
Sets KeepOnScreen setting for specified group. NewSetting can be 0 (off), 1 (on), or -1 (toggle). - !ClickThrough [NewSetting] (Config)
Sets ClickThrough setting for current / named / all configs. NewSetting can be 0 (off), 1 (on), or -1 (toggle). - !ClickThroughGroup [NewSetting] [Group]
Sets ClickThrough setting for specified group. NewSetting can be 0 (off), 1 (on), or -1 (toggle). - !SnapEdges [NewSetting] (Config)
Sets SnapEdges setting for current / named / all configs. NewSetting = -1 (toggle) | 0 (off) | 1 (on) - !SnapEdgesGroup [NewSetting] [Group]
Sets SnapEdges setting for specified group. NewSetting can be 0 (off), 1 (on), or -1 (toggle).
Actions for a meter or group of meters
- !HideMeter [Meter] (Config)
Hides the given meter. Note that hiding meter does not stop the measurement, you also need to disable the measure if you don't want to spend the extra CPU cycles for the measuring. - !ShowMeter [Meter] (Config)
Shows the given meter if it was hidden. - !ToggleMeter [Meter] (Config)
Toggles the visibility of the given meter. - !UpdateMeter [Meter] (Config)
Immediately updates the given meter regardless of UpdateDivider. - !MoveMeter [X] [Y] [Meter] (Config)
Moves the given meter (not the window) to the specified position. - !ShowMeterGroup [Group] (Config)
Shows all of the meters in the specified group. - !HideMeterGroup [Group] (Config)
Hides all of the meters in the specified group. - !ToggleMeterGroup [Group] (Config)
Toggles the visibility of all of the meters in the specified group. - !UpdateMeterGroup [Group] (Config)
Immediately updates all of the meters in the specified group regardless of UpdateDivider.
Actions for a measure or group of measures
- !DisableMeasure [Measure] (Config)
Disables the given measure. - !DisableMeasureGroup [Group] (Config)
Disables all of the measures in the specified group. - !EnableMeasure [Measure] (Config)
Enables the given measure. - !EnableMeasureGroup [Group] (Config)
Enables all of the measures in the specified group. - !ToggleMeasure [Measure] (Config)
Toggles the status of the given measure (i.e. disabled/enabled). - !ToggleMeasureGroup [Group] (Config)
Toggles the status of all of the measures in the specified group (i.e. enabled/disabled). - !UpdateMeasure [Measure] (Config)
Immediately updates the given measure regardless of UpdateDivider. - !UpdateMeasureGroup [Group] (Config)
Immediately updates all of the measures in the specified group regardless of UpdateDivider. - !PluginBang "[MeasureName] (Arguments)" (Config)
This bang has been deprecated in favor of !CommandMeasure and should not be used in any new skins. - !CommandMeasure ["Measure"] ["Arguments"] ("Config")
Sends a command to the given measure. The arguments depend on the measure in question.