Skip to content
Image file watcher module for MagicMirror2
JavaScript
Branch: master
Clone or download
BuildTools
BuildTools Added functionality to show images uploaded from PushBullet via the M…
…MM-PushBulletNotifications module. Added configuratino option 'processPushBulletNotifications' for this purpose.
Latest commit 81fb744 Dec 9, 2018

README.md

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
You can’t perform that action at this time.