Skip to content

basknol/MMM-ImageFileWatcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Module: MMM-ImageFileWatcher

This MagicMirror² module watches one or multiple directories, this module displays an image for a specified number of seconds if an image is added to the watched directory. For example an image uploaded via SFTP from your phone.

This module can also show images uploaded to PushBullet on your Mirror. Therefore install the MMM-PushBulletNotifications module and add the configuration option processPushBulletNotifications (in the MMM-ImageFileWatcher configuration) and set it to true.

Inspired by the MMM-ImageSlideshow module created by GitHub user Adam Moses

Dependencies / Requirements

This module uses chokidar (https://github.com/paulmillr/chokidar) to watch if files are added to a directory. Chokidar is a wrapper around node.js fs.watch / fs.watchFile / fsevent. Required is that the configured image directories have to be accessible to the Magic Mirror instance to be able to show the images on the Magic Mirror

Installation

In your terminal, go to your MagicMirror's Module folder:

cd ~/MagicMirror/modules

Clone this repository:

git clone https://github.com/basknol/MMM-ImageFileWatcher.git

Go to the MMM-ImageFileWatcher folder:

cd MMM-ImageFileWatcher

Install necessary dependencies:

npm install

Using the module

To use this module, add it to the modules array in the config/config.js file:

modules: [
	{
		module: 'MMM-ImageFileWatcher',
		position: 'middle_center',	// This can be any of the regions.		
		config: {
			// See 'Configuration options' for more information.
			imagePaths: ['modules/MMM-ImageFileWatcher/Images']
		}
	}
]

Configuration options

The following properties can be configured:

Option Description
imagePaths Array value containing strings. Each string should be a path to a directory where image files can be found.

Example: ['modules/MMM-ImageFileWatcher/Images']
This value is REQUIRED
fixedHeight Integer value, sets a fixed pixel height for image to be shown. If set to 0, the image's actual height is used.

Example: 300
Default value: 0
This value is OPTIONAL
fixedWidth Integer value, sets a fixed pixel width for image to be shown. If set to 0, the image's actual width is used.

Example: 300
Default value: 0
This value is OPTIONAL
showtime Integer value, the length of time to show the image in milliseconds. If multiple images are place in image directories, each image is shown for configured 'showtime'

Example: 5000
Default value: 10000
This value is OPTIONAL
hideModules Array value containing strings. Each string should be the name of a module to hide when image is shown, this can be used to avoid overlap modules

Example: ['compliments', 'calendar', 'newsfeed']
Default value: empty array []
This value is OPTIONAL
validImageFileExtensions String value, a list of image file extensions, seperated by commas, that should be included. Files found without one of the extensions will be ignored.

Example: 'png,jpg'
Default value: 'bmp,jpg,gif,png'
This value is OPTIONAL
processPushBulletNotifications Boolean value, show images uploaded to PushBullet (=true). This requires that the MMM-PushBulletNotifications is installed.

Example: true
Default value: false
This value is OPTIONAL

About

Image file watcher module for MagicMirror2

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published