Read the statement by Michael Teeuw here.
A way to add image name to MMM-BackgroundSlideshow?
-
Hi,
New here, just got an RPI and am thrilled with it, MM and the 3rd party modules. I’ve set up MMM-BackgroundSlideshow to randomly show backgrounds from a few thousand pictures on my NAS. Every once in a while I see an image that I’d like to remove or edit. Is there a way to get the image filename to show somewhere on the display? (I’m not much of a coder)
Thanks! -
FWIW, I did manage to do this. I added a line 155 to the MMM-BackgroundSlideshow.js:
image.src = encodeURI(this.imageList[this.imageIndex]); this.sendNotification("IMAGEFILEPATH", image.src); //my stuffThen I created a small module that displayed the notification.
Module.register("MMM-ShowMessage", { defaults: {}, getDom: function() { var element = document.createElement("div"); element.className = this.config.size; element.id = "IMGPATHFILE"; return element; }, notificationReceived: function(notification, payload, sender) { switch(notification) { case "IMAGEFILEPATH": var elem = document.getElementById("IMGPATHFILE") var subpayload = payload.substring(53) elem.innerHTML = subpayload break } }, });In my config.js I just added:
{ module: "MMM-ShowMessage", position: "bottom_left", config: { size: "small" } },Now each time the image changes a notification is sent and picked up by the show message module which displays it on screen. I trim the path because the beginning was consistent among all the pictures.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login