Introduction
LuaCalendar is a Calendar skin designed for use with the Rainmeter program. By using the power of the Lua scripting language, the skin loads instantly and is exrtremely flexible. The skin itself is designed to use Style Sheets, allowing for complete customiztion of the look and feel of the skin while retaining all of the functionality of the script.
One of the major features of the skin is the abiltiy to display events that are defined by the user. This was a long requested feature of the existing calendar skins. All of the easily configured settings and features are listed below.
Release Notes
Download from GitHub.
Version 4.1
11/4/2012 |
- Fixed a fatal error when no Repeat was set for an event.
- Made the script more modular.
- Changed variables to use XML standard syntax.
- Updated the Enigma style.
- Added support for the new MouseScroll actions introduced in the Rainmeter 2.5 beta.
- Added option for SingleFolder option.
- Reinstated Range option for displaying Month or Week range.
See more changes
|
Calendar Settings
All settings can be found in Settings.inc
- Style
- StartOnMonday
- Set to 1 to have the week start on Monday.
- Defaults to
0
- DayLabels
- A pipe delimited list of custom text for Weekday labels.
- Uses the following format:
Sun|Mon|Tue|Wed|Thu|Fri|Sat
- Note: Do not adjust for StartOnMonday. This is done automatically.
- Defaults to
S|M|T|W|T|F|S
- MonthLabels
- A pipe delimited list of custom text for Month labels.
- Uses the following format: Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec
- Defaults to
1|2|3|4|5|6|7|8|9|10|11|12
- LabelText
- Allows for personalized formatting of the calendar title. A list of available variables can be found here.
- Example:
LabelText={$MName} of {$Year}
- Defaults to
{$MName}, {$Year}
- LeadingZeroes
- Set to 1 to add a leading zero to any number below 10.
- Defaults to
0.
- HideLastWeek
- Set to 1 to hide week 6 if not included in the current month.
- Defaults to
0.
- UseLocalMonths
- Set to 1 to pull month names from the Localization Settings of your computer. Overrides Custom Month Labels.
- Note: This setting will affect all loaded skins that use the time measure. Use with caution.
- Defaults to
0.
- EventFile
- A pipe delimited list of paths to Event files formatted as described below.
- These paths are relative to the skin folder unless a full path is specified.
- NextFormat
- The formatting used for the NextEvent skin variable. Use
{$day} to display the day number and {$desc} for the comma delimited list of events.
- Defaults to
{$day}: {$desc}.
- Range
- Can be set to either Month or Week to display a whole month or just the current week.
- Setting to Week disables the ability to move through the calendar.
- Defaults to
Month.
- SingleFolder
- When set to 1, the first item in the EventFile list is used as the path for all items following it.
- Default to
0
Skin Actions
LuaCalendar has the ability to show different months while using the Month range. While some styles may have visual elements for this, not all do. This is where the Skin Actions come in.
Scroll Actions
When hoving over the skin, scroll using the scrollwheel on the mouse up to move back and down to move forward. This action is based on the update speed of the skin. It groups multiple scrolls during on update into a single scroll action.
Context Menu Actions
Under the submenu named "Custom skin actions" in the context menu several options have been made available. These options include editing of the calendar options, moving through the months, and returning to the current month.
Using Event Files
To use Event Files set EventFile to the path of a text file on the calendar measure. Multiple files can be aggregated together using a pipe delimiter.
Examples
EventFile=Holidays\Holidays.hol
EventFile=Holidays\Holidays.hol|Holidays\BDays.hol
There is no limit to the number of Events used. Event files must be formatted in the following XML style format, indents not required.
<EventFile Title="Holidays" Repeat="Year">
<Event Month="1" Day="10" Description="Event Description"/>
<Set Month="2">
<Event Day="12" Description="Some Other Event"/>
</Set>
<!--This is a comment.-->
</EventFile>
The complete contents of the Event file must be enclosed in <EventFile></EventFile> tags. The following settings may be set on each tag and are overridden by those nested within them.
- Title*
The title of the event which is displayed after the events.
- Month
The month in which the event occurs. This setting allows the use of formulas and Variables.
- Day
The day on which the event occurs. This setting allows the use of formulas and Variables.
Example:<Event Month="11" Day="({$FirstMon}+1)*(({$Year}%2)=0)" Repeat="Year" Description="Election Day"/>
- Election day is defined as the Tuesday folllowing the First Monday in November every even numbered Year.
- Year*
The Year the event occurs on.
- Description
The description of the event.
- Color*
The RGB or HEX color to be used for the specified event(s).
Example:<Event Month="1" Day="4" Year="1986" Color="FF0000FF" Repeat="Year" Description="Smurfier's BDay"/>
- Repeat*
When used, this option allows an event to repeat using a specified pattern.
- Month
The event repeats on the same day each month. If a multiplier is used a full date must be specified, else only a day is necessary.
- Year
The event repeats on a yearly basis. Month and day must be specified.
- Week
The event repeats on a weekly basis. A full date must be specified.
- Multiplier*
The frequency an event repeats.
- Anniversary*
When set to true the number of times the event has repeated will be shown.
Example:<Event Month="1" Day="4" Year="1986" Repeat="Year" Anniversary="true" Description="Smurfier's BDay"/>
- Appears as:
Smurfier's BDay (26)
- Inactive*
When set to true the event is skipped when parsing the Event File.
*This field is optional.
Variables
There are two instances when certain Variables can be used with LuaCalendar settings. The first being LabelText and the other being in the Day parameter of Holiday Files. Variables are surrounded by {$Curly Brackets} with the dollar sign in front of the variable name, and are case insensitive.
Static Variables
{$MName}
- The name of the current month. If a name is not provided the month number is used.
{$Year}
{$Today}
- The current day number. This variable follows the LeadingZeroes setting.
{$Month}
- The current month number.
Variable Days
Variable Days are used to calculate holidays that occur on days like the Second Tuesday of the month. They are defined using the following keywords.
Starts with: First, Second, Third, Fourth, Last
Ends with: Sun, Mon, Tue, Wed, Thu, Fri, Sat
Example:
<Event Month="11" Day="{$FourthThu}" .../>
Built-In Event Variables
In order to support events that require complex calculations, LuaCalendar supports certain Built-In events. These events create both a {$EventNameMonth} and an {$EventNameDay} variable. The value of these variables are recalculated for each year so that they are kept up to date.
Currently the supported Built-In Events are Easter, GoodFriday, AshWednesday, and MardiGras.
Style Sheets
LuaCalendar uses style sheets in order to allow for complete customization of the look and feel of the skin. Style sheets are files with individual MeterStyles and Variables used to define the meter properties of the skin. These files in located in the Styles folder, under another folder whose name defines the name of the style sheet.
There are three style sheets included with LuaCalendar. The Default style is very basic and is based on the old Enigma calendar. Default2 shows a little bit of what the style sheets can actually do. The third style sheet is made to match the Enigma 3.1 calendar.
Creating Style Sheets
There are two files used to create a style sheet. Styles.inc contains all of the meter styles required as well as any special meters. Variables.inc is used to create any variables specifically used by the style sheet.
- Required Meter Styles
These meter styles are required and are defined in Styles.inc
- Day Labels
- LblTxtSty
- Used to define the main text properties of the Day Labels.
- LblTxtStart
- Used to define the properties of the first day label.
- LblCurrSty
- Used to define the current day of the week.
- Main Text Styles
- TextStyle
- Defines the main text properties for the calendar days.
- FirstDay
- Defines the properties of the first calendar day.
- NewWk
- Defines the first day of each week.
- CurrentDay
- Defines the current day of the month.
- LastWeek
- Defines the last week of the month when the current month does not extend to week 6.
- Only applies when HideLastWeek is set to 1.
- PreviousMonth
- Defines the days in the previous month.
- NextMonth
- Defines the days in the next month.
- HolidayStyle
- Defines the days on which a holiday occurs.
- This style is added onto other styles.
- WeekendStyle
- Defines weekends in the current month.
- Script Defined Variables
These variable are created and updated by the script.
- ThisWeek
- Defines the week in which the current day occurs.
- Returns a number in the range 1-6.
- Week
- Defines the weekday.
- Returns a number in the range 0-6.
- Today
- Defines the current day number.
- Follows LeadingZeroes.
- Month
- The current name of the month.
- Year
- MonthLabel
- The month label as defined by the LabelText setting.
- NotCurrentMonth
- Set to 1 when browsing outside the current month, else 0.
- LastWkHidden
- Set to 1 if week 6 is hidden.
- NextEvent
- A list of upcomming events in the currently displayed month following the style defined in the NextFormat setting.
- WeekNumberN
- WeekNumberN (where N is the numbers 1-6) is the week number (1-53) of the week.
- Script Functions
These functions can be used with !CommandMeasure "ScriptMeasure" "Command()" to control the calendar.
- Move(number)
- Moves the calendar number of months. The number parameter must be a whole integer and can be either positive or negative.
Changelog
4.1 (11/27/2012)
- Fixed a fatal error when no Repeat was set for an event.
- Made the script more modular.
- Changed variables to use XML standard syntax.
- Updated the Enigma style.
- Added support for the new MouseScroll actions introduced in the Rainmeter 2.5 beta.
- Added option for SingleFolder option.
- Reinstated Range option for displaying Month or Week range.
- Removed DayPrefix and MeterPrefix skin settings. Now set in script file.
4.0 (11/4/2012)
- Changed Event files to use a more robust system for repeating events.
- Fixed HideLastWeek.
- Moved Calendar files to Calendars folder.
- Moved Event list to bottom of the calendar on DefaultEvents style.
- Added Inactive option for events.
- Move function now accepts any whole integer.
- Added Custom Context Menu actions.
- Fixed Custom Event Colors with nested tags.
- Added WeekNumber variables.
- Added DefaultWeeks style.
3.5 (7/20/2012)
- Updated Event file formatting.
- Added Custom Colors to Event files.
- Added support for nested Set tags in Event files.
- Added support for custom built in Events.
- Added support for formulas in the Month parameter.
- Fixed inline tags.
- Added Version Checking
3.4 (5/22/2012)
- Added Ghost meter to Default styles to enforce skin size.
- Added NextEvent skin variable.
- Updated to use @Resources folder.
3.3 (4/18/2012)
- Removed support for
<Title></Title> tags.
- Added support for xml comments.
- Changed to use proper xml formatting.
- Added more error checking.
- Changed
HolidayFile to EventFile
3.2.2 (3/26/2012)
- Minor code optimizations.
- Added Good Friday to built in events.
- Changed all variables to be defined by {Curly Brackets}.
- Changed all variables and holiday parameters to be case insensitive.
- Made script more readable.
3.2.1 (3/12/2012)
- Added support for VariableDays in Day Formulas.
- Removed Formula parameter in Holiday Files, now unnecessary.
- Removed !StartDay Variable.
3.2 (3/11/2012)
- Minor code optimizations.
- Holiday File paths are now relative to the skins folder unless an absolute path is provided.
- Converted to use a different method of retrieving settings.
- Added support for formulas in Day parameter of Holidays.
3.1.3 (3/1/2012)
- Minor code optimizations.
- Increased script readability.
- Fixed a bug regarding highlighted WeekDay and Current Day styles.
- Fixed a bug that prevented the calendar from switching to a new month.
3.1.2 (2/24/2012)
- Removed reference to non-existent variable.
3.1.1 (2/7/2012)
- Fixed Bug regarding Holidays and StartOnMonday.
3.1 (2/5/2012)
- Changed to use Style Sheets.
- Minor code optimizations.
3.0.1 (1/2/2012)
- Fixed an error regarding StartOnMonday.
- Added %3 for current day with LabelText.
3.0 (1/21/2012)
- Fixed the calculation used for Leap Years.
- Holiday files are now only loaded at startup.
- Removed support for Google Calendars. (It was messy and never really worked properly.)
- Removed the option to show only the current week.
- Made several code optimizations.
- Added LabelText for custom formatting of the Month Label.
- Added highlighting for the current weekday and the current day of the month.
- Added a different option for highlighting the current day.
- Added a new variable, LastWkHidden, which is set to 1 if the last week of the month is hidden.
2.2.3 (1/15/2012)
- Squashed a few bugs.
- Made several code optimizations.
2.2.2 (8/22/2011)
- Fixed error with StartOnMonday where wrong day was indicated.
- Added calendar names to events.
- Added
<Title></Title> to holiday files to comply with showing calendar names in events.
- Worked to fix problem with all day events with google calendar.
- Moved most calendar settings to Settings.inc and set rmskin to migrate settings on upgrade.
2.2.1 (8/14/2011)
- Updated to fix error with dates in Holiday files.
2.2 (8/13/2011)
- Added the ability to retrieve and show multiple Google Calendar feeds.
- Added the ability to use multiple holiday files.
- Added option for anniversaries.
- Added option for WeekendColor.
- Made many code optimizations.
2.1 (8/8/2011)
- Fixed MonthLabels to use non-english characters.
- Added UseLocalMonths and HideLastWeek.
2.0 (8/8/2011)
- Fixed one line of code involving included variables.