Read the statement by Michael Teeuw here.
Changing compliments
-
@Stacy save it as the same file. But please do not use windows programs like word or wordpad to edit it. They will break the file. In windows you should use e.g. notepad or notepad++. On debian/raspbian you can use whatever you like
-
@lavolp3 thanks. I am using nano.
-
@Stacy so, just to clear, I go to modules folder, then default, then compliments, then compliments.js. to edit?
-
@lavolp3 so I go to modules, default, compliments, and change it there? I just want to make sure I am in the right folder. Thank u SO much for helping.
-
@Stacy No.
I thought you had changed the config/config.js file. This is the central MM config file. If there is one synthax error in this file, the mirror won’t load. Post the content of that here without personal info (like API keys or passwords) OR go into the magicmirror folder and do “npm run config:check”, which will tell you where the error is. -
@lavolp3 so how do I get to the modules to change them?
-
MagicMirror/config/config.js is the file you want to edit.
If you edit the actual modules files (which is not recommended) then you risk breaking MM altogether.
-
@Stacy said in Changing compliments:
@lavolp3 so how do I get to the modules to change them?
All the modules get their information from the config.js cruunnerr and Mykle mentioned. You don’t need to change anything in the module folders.
If the module code is broken at the moment, you can rebuild it from – or completely replace it with – the original here if you don’t want to start over again.
This is the basic code for the compliment module to be added/changed/edited in the MagicMirror/config/config.js :
{ module: "compliments", position: "lower_third", // This can be any of the regions. // Best results in one of the middle regions like: lower_third config: { compliments: { anytime: [ "Hey!", // properties are followed by commas – most common mistake "Hello." // last property within brackets doesn't get a comma ], morning: [ "Hey!" ], evening: [ "Hey!" ] } } } // add a comma (,) if another module's config is following
See the comments in the code. The most common mistakes are missing commas or missing brackets.
-
@doubleT So, I am in the directory MagicMirror. I opened nano to the file MagicMirror/config/config.js
I chose the config.js fileI added my city and I’d to the current weat her and weather forecast. I added some compliments as shown above.
When I tried to save I got an error writing to MagicMirror/config/config.js. no such file or directory
-
That’s the correct file.
Trysudo nano MagicMirror/config/config.js
if you haven’t used sudo, that gives you advanced rights.Did you create config.js? I have a suspicion. At the beginning, there’s no config.js, you have to create it. But there’s a sample file.
Let’s check.
You’re in the dir MagicMirror,
cd config
change the directory to config
ls
list the dir contents. There should be a config.js.sample. If there is also a config.js, ignore the next step.
sudo cp config.js.sample config.js
makes a copy of config.js.sample and creates config.js
ls
should now show both files.
sudo nano config.js
to edit the config.js