An add-on to toast notifications for Rainmeter desktop customization tool.
This is an app you can use with RunCommand plugin to send toast notifications to users.
Some important points before beginning:
- All elements are rendered in the order they are defined.
- You must avoid unwanted spaces where delimiters are used, e.g.`|`
- You must put strings that contain whitespace characters inside double quotes, e.g. `"string with whitespace"`.
- You must escape double quotes that are present within the string, e.g. `"string \"with\" quotes"`
- All paths are relative.
- This is the program toast notification will execute when interacted with by user. Default value is default path to Rainmeter, e.g. ProgramFiles\Rainmeter\Rainmeter.exe.
- If you are distributing your skin, it is highly recommended that you use
#PROGRAMPATH#Rainmeter.exe
as program path. - It can be other than Rainmeter but make sure you pass valid parameters.
- Syntax:
--programpath "<absolutepath>"
- Example:
--programpath "#PROGRAMPATH#Rainmeter.exe"
- This the argument that will be passed down to the program if the body of the toast is clicked. Default is
[!Log \"Toasted from Raintoast!\"]
- Make sure you provide a parameter if your
programpath
is different than Rainmeter. - InputBox or SelectionBox not supported.
- Syntax:
--parameter "<parameters>"
- Example:
--parameter "[!Log Hello][!Log \"I am death.crafter, creator of this skin.\"]"
- The first adaptive text is the title of your toast.
- Second and third will appear under the title.
- Each adaptive text can be of maximum two lines.
- Syntax:
--text "<string>"
- Example:
--text "Title" --text "Info 1" --text "Info 2"
- This will appear as a small line of text under adaptive text.
- Syntax:
--attribution "<string>"
- Example:
--attribution "via MyExampleSkin"
- This will be the logo shown in the toast.
- The logo image must be kept in the directory where the app is. E.g. if the app is in @Resources\Toaster, image can be in @Resources\Toaster\Assets.
- Syntax:
--logo "<relativepath>"
- Example:
--logo "Assets\myToastLogo.png"
- This will appear on the top of toast notification, like a header image. Path must be relative. See Logo #2.
- Syntax:
--heroimage "<relativepath>"
- Example:
--heroimage "Assets\myHeroImage.png"
- This will appear as a big image embedded in the toast notification. Path must be relative. See Logo #2.
- Syntax:
--inlineimage "<relativepath>"
- Example:
--inlineimage "Assets\myInlineImage.png"
- Well, buttons.
- Syntax:
--button "<name>" "<parameter>"
- Example:
--button "Okay" "[!Log Okay]" --button "Cancel" "[!Log Cancel]"
- Get text input from user. New lines will be replaced by
#CRLF#
. - Use
$<id>$
in button parameter to get the input, newline characters will be resolved normally. - Use
$<id>:CRLF$
in button parameter to get the result with newline characters resolved to #CRLF#. Especially useful with !WriteKeyValue. - Syntax:
--inputbox "<id>" "<defaulttext>"
- Example:
--inputbox "name" "Enter your name" --button "Okay" "[!SetOption MeterString Text \"Your name is $name$\" \"#CURRENTCONFIG#\"][!WriteKeyValue MeterString Text \"Your name is $name:CRLF$\" \"#CURRENTPATH##CURRENTFILE#\"]"
- User can select from given options. There can be a max of 5 options to choose from.
- Use
$<id>$
in button parameter to get selection. - Syntax:
--selectionbox "<id>" "<option1value>|<option1text> <option2value>|<option2text>" ...
- Options are defined as
&default;<value>|<text>
where,&default;
: use this at the start of default option. don't forget the semicolon.value
: return valuetext
: text shown as option to user
- Example:
--selectionbox "theme" "dark|Dark" "light|Light" "&default;githubdark|GitHub Dark" "githublight|GitHub Light" "solarized|Solarized" --button "Okay" "[!Log \"$theme$ was chosen.\"]"
- Github Dark will be the default option.
[Rainmeter]
Update = 1000
AccurateText = 1
[Metadata]
Author = death.crafter
Version = 1.0.0.1
License = Attribution 4.0 International (CC BY 4.0)
Information = Example skin for Raintoaster
[Variables]
Name =death.crafter
AgeGroup =Youth
;Notification content
Program = --programpath "#PROGRAMPATH#Rainmeter.exe"
Title = --text "MyExampleSkin"
Info = --text "This is a test run of the Raintoaster addon."
Info2 = --text "Please provide the requested info."
Logo = --logo "Assets\myLogo.png"
InputBox = --inputbox "name" "Enter your name"
SelectionBox = --selectionbox "agegroup" "&default;Not provided|Please select age" "Children|Below 14" "Youth|15-28" "Middle|29-48" "Old|Above49"
Button = --button "Okay" "[!SetVariable Name \"$name$\" \"#CURRENTCONFIG#\"][!SetVariable AgeGroup \"$agegroup$\" \"#CURRENTCONFIG#\"][!WriteKeyValue Variables Name \"$name:CRLF$\" \"#CURRENTPATH##CURRENTFILE#\"][!WriteKeyValue Variables AgeGroup \"$agegroup:CRLF$\" \"#CURRENTPATH##CURRENTFILE#\"][!Update \"#CURRENTCONFIG#\"]"
Button2 = --button "Cancel" "[!Log \"No information provided\"]"
[Toaster]
Measure = Plugin
Plugin = RunCommand
Program = #@#Raintoaster.exe
Parameter = #Program# #Title# #Info# #Info2# #Logo# #InputBox# #SelectionBox# #Button# #Button2#
[MeterString]
Meter = String
FontFace = Segoe UI
FontSize = 20
AntiAlias = 1
SolidColor = FFFFFF
DynamicVariables = 1
Text = Name: #Name##CRLF#Age Group: #AgeGroup#
LeftMouseUpAction = [!CommandMeasure Toaster Run]