MMM-Dictons is an extension for the MagicMirror. It provides a saying on the screen (dicton in french).
Multiple options provide the possibility to select sayings among themes or to display saying based on the current date.
- Navigate into your MagicMirror's
modules
folder and executegit clone https://github.com/plezy/MMM-Dictons.git
. - Configure the
config.js
file to suits your needs. - Reboot your Pi.
The entry in config.js
can look like the following.
You only have to add variables to config if you want to change the standard value.
...
},
{
module: 'MMM-Dictons',
position: 'top_left',
config: {
select: "day"
}
},
}
...
Option | Description |
---|---|
select |
selects the display type. 'day' displays the saying for the current day. Any other options are overidden. 'all' will display sayings of any themes based on all available themes. Finally, you can select a comma separated list of themes. (eg : 'love,nature' ) |
Sayings are stored in the folder modules/MMM-Dictons/dictons
. A database file is created for each language. The file name is built with dictons
follown by the two uppercase letters representing the language. Finally, file's extension is .json
.
As expressed by the filename's extension, it is a JSON formatted file.
It is built as a javascript object containing theme named object's consisting of a list of sayings for the theme.
example:
{
"love": [
"Love starts with a hug, grows with a kiss, and ends with a tear.",
"Guys are like stars, there are millions of them, but only one makes your dreams come true."
],
"mother": [
"Always love your mother because you will never get another.",
"Birth is the only time when you cry and your mother smiles."
],
...
}
Saying of the day is a special object named 'day'
. this object is built of month's objects containing in turn day's object.
Only one object named 'day'
may occur in a file but other themes may be defined in the file.
Objects for a day contains the list of string to be used for a day.
example:
{
"day" :
{ "1" :
{ "1" : [
"Nuit du nouvel an sereine, signe d'une année pleine.",
"À l'an neuf, le jour augmente d'un pas de bœuf.",
]
,
"2" : [
"Le temps du deux janvier présage celui de septembre.",
"Saint Clair porte quarantaine."
]
....
}
,
"2" :
{ "1" : [
"Janvier et février comblent ou vident le grenier.",
"Que si janvier est bouier, ne le sont ni mars ni février.",
]
,
....
}
,
...
}
,
...
}