Read the statement by Michael Teeuw here.
MM-Watcher - MagicMirror Config.js Auto-Refresh Script
-
@chrisfr1976 if you used my installer script, and selected pm2, I auto configure for watching the config.js file
BUT they changed the construct to only watch a folder… dumbjust fyi… if the changes you are making are in css or the UI side (modulename.js)
you don’t have to restart, just refresh the page with ctrl-r
as those two files are reloaded on refresh -
@sdetweil thats why I made the module. The Pi is completely headless. So I’m in the kitchen with my laptop and enjoy this autorefresh now. Before that I’ve used a Script on my Smartphone. Also manual and annoying :-)
And sure, also the xdotool command is just pressing “ctrl+r” for me. -
{ "name":"mm", "script":"./mm.sh", "cwd":"/home/pi", "watch":[ "//home/pi/MagicMirror/css/custom.css", "/home/pi/MagicMirror/config/config.js" ], }I use a file called mm.json ,don’t remember where I got this info, but it still works great. I have it and a copy of the mm.sh in the /home/pi/ folder… the one your setup goes to when you do cd then enter.
this is the code inside it.
pm2 delete all that have to do with MagicMirror startup.
Then do a pm2 start mm.json then pm2 save and PM2 saves it as mm.
Now anytime I change something in config.js MagicMirror restarts.
I wish I was smart enough with code to figure out how to get it to restart when I modify the custom.css too. -
@plainbroke great!!! i will fix my json file !!!thanks
-
@plainbroke
Hi,
my mm.sh also restarts the mirror. But my intention with was doing only a refresh to save a lot of time. My restarts script sleeps 15s before it is executed. So i created a seperate refresh script. -
@chrisfr1976
Ok mine doesn’t wait. I usually do a list of changes I have researched.
So the complete restart of MM is ok for me.
Right now trying to figure out a couple of modules that are not loading… -
@plainbroke interesting, my file and your have just two changes
- you have the cwd: setting
- you have followSymlinks (which we don’t have any of)
I added cwd to mine and now MM restarts… weird
-
@sdetweil
Glad it works for you.
I have no Idea where it came from. I would guess from someone on this forum. -
@plainbroke well, mine looks nearly identical… just missing the cwd…
I opened an issue about this 2 years ago, never got a response…
and adding cwd (current working directory)I don’t know how that matters… but whatever… it works now…
-
@sdetweil or @chrisfr1976 , I am using Wayland instead of x11 and my display is undefined.
From MagicMirror, using
node --run start:x11everything works just fine with a refresh script referencingexport DISPLAY=:0.0 && xdotool key ctrl+r.My startup script however uses Wayland and then I run into issues. Have you ran this on wayland successfully?
-
@magicmikael pm2 is supposed to be able to do this too. But altho I set it up during pm2 setup in my scripts it doesn’t work
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