Simple and plain text module for the MagicMirror² project. You can use a sentence of choice and use some minor formatting options.
- Navigate into the modules directory and clone the repo:
cd MagicMirror/modules
git clone https://github.com/SaltyRiver/MMM-SimpleText.git
- Insert the following part into your config file and choose your settings ../MagicMirror/config/config.js
{
module: 'MMM-SimpleText',
position: 'top_center',
config: {
text: {
'value': 'Hello World!'
},
fontURL: {
'value': 'Tahoma, Geneva, sans-serif'
},
fontSize: {
'value': 'xx-large'
},
fontStyle: {
'value': 'italic'
},
color: {
'value': '#FFFFFF'
}
}
},
{
module: 'MMM-SimpleText',
position: 'top_center',
config: {
text: {
'value': 'I am green!'
},
fontURL: {
'value': 'Tahoma, Geneva, sans-serif'
},
fontSize: {
'value': 'xx-large'
},
fontStyle: {
'value': 'normal'
},
color: {
'value': '#008000'
}
}
},
The following properties can also be used to add more functionality:
- refreshMs - Refresh this module every x milliseconds (default: 3600000)
refreshMs: {
'value': '10000'
},
- filePath - Read and display the content from a local .txt file. The file has to exist within the MMM-SimpleText directory! Note that when filePath is being used the text property will be ignored.
filePath: {
'value': 'test.txt'
},
Linebreaks - When reading text from a file, line breaks will be included
Below you can find a complete example with those two properties beeing used:
{
module: 'MMM-SimpleText',
position: 'top_center',
config: {
fontURL: {
'value': 'Tahoma, Geneva, sans-serif'
},
fontSize: {
'value': 'xx-large'
},
fontStyle: {
'value': 'italic'
},
color: {
'value': '#FFFFFF'
},
refreshMs: {
'value': '10000'
},
filePath: {
'value': 'test.txt'
},
}
},