Skip to content

Simple and plain text module for the MagicMirror project

License

Notifications You must be signed in to change notification settings

SaltyRiver/MMM-SimpleText

Repository files navigation

MMM-SimpleText

Simple and plain text module for the MagicMirror² project. You can use a sentence of choice and use some minor formatting options.

Screenshot

Installation

  1. Navigate into the modules directory and clone the repo:
  cd MagicMirror/modules
  git clone https://github.com/SaltyRiver/MMM-SimpleText.git
  1. 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'
			}
		}
},

Customization example

Screenshot

{
 	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'
			}
		}
},

Further settings

The following properties can also be used to add more functionality:

  1. refreshMs - Refresh this module every x milliseconds (default: 3600000)
refreshMs: {
  'value': '10000'
},
  1. 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'
},
  1. Multiple module definitions - to have more then one MMM-SimpleText module in config.js assign an unique ID to each
UniqueID: {
  'value': 'MMM-SimpleText-0'
},

Linebreaks - When reading text from a file, line breaks will be included Screenshot

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'
			},
                        UniqueID: {
                          'value': 'MMM-SimpleText-0'
                        },
		}
},

About

Simple and plain text module for the MagicMirror project

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published