MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    A way to add image name to MMM-BackgroundSlideshow?

    Scheduled Pinned Locked Moved General Discussion
    2 Posts 1 Posters 1.2k Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R Offline
      rts58
      last edited by

      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!

      1 Reply Last reply Reply Quote -1
      • R Offline
        rts58
        last edited by

        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 stuff
        
        

        Then 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.

        1 Reply Last reply Reply Quote 3

        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
        • 1 / 1
        • First post
          Last post
        Enjoying MagicMirror? Please consider a donation!
        MagicMirror created by Michael Teeuw.
        Forum managed by Sam, technical setup by Karsten.
        This forum is using NodeBB as its core | Contributors
        Contact | Privacy Policy