bastilimbach / docker-MagicMirror

Docker image for the Magic Mirror 2 project by Michael Teeuw.
https://hub.docker.com/r/bastilimbach/docker-magicmirror/
MIT License
186 stars 54 forks source link

How can i change compliments? #10

Closed dersch81 closed 6 years ago

dersch81 commented 6 years ago

Hi, i've switching from standalone pi to a docker mirror. It is running now, but i had a custom compliments file. I included that to my custom folder of modules as i did that with the standalone MM. But how will this affect any updating? In the past i had to change the compliments.js to the original version to update my mirror via git.

bastilimbach commented 6 years ago

If I'm correct you can include the compliments either in the config.js file or in a external file. If you include the compliments directly into the config.js or the external file is in the config or modules folder, they won't get overridden on an update. It's important, that you add these as volumes!

dersch81 commented 6 years ago

Ok thanks a lot. Would this be the same dir changes in a CSS file for the Mirror? As suggested by the rtspstream Module maintainer i need a CSS change:

~/MagicMirror/css/custom.css file.

.MMM-RTSPStream .innerWrapper {
  margin: 0px;
}
bastilimbach commented 6 years ago

Oh ok, that's something I didn't consider. It was new to me, that you could write your own custom css in css/custom.css. Theoretically, it should work if you mount the css/custom.css file using volumes:

--volume ~/your/path/custom.css:/opt/magic_mirror/css/custom.css

I'll take a look at this and update the README if it works as expected.

bastilimbach commented 6 years ago

@dersch81 I updated the README to reflect this use case (1e14e332ebbf17504863036d1e7521700046d70c). I tested it yesterday and it worked as expected. 👍It's important, that you create your custom.css file before you mount/run the container. I hope this helps you. If you have any further questions, please feel free to reopen this issue.

dersch81 commented 6 years ago

Thanks a lot! I'm actually playing around with it.

My change of the custom.css doesn't change anything acutally.

/*****************************************************
 * Magic Mirror                                      *
 * Custom CSS                                        *
 *                                                   *
 * By Michael Teeuw http://michaelteeuw.nl           *
 * MIT Licensed.                                     *
 *                                                   *
 * Add any custom CSS below.                         *
 * Changes to this files will be ignored by GIT. *
 *****************************************************/

body {
  .MMM-RTSPStream .innerWrapper {
    margin: 0px;
  }
}
bastilimbach commented 6 years ago

If you mount the /css folder you need to copy the main.css and custom.css file manually into it, correct. If you just mount the custom.css file instead of the whole folder, you don't need to do anything with the main.css file.

Your css changes aren't working, because they are not correct. In normal CSS you can not nest rules. This only works in SASS for example.

It should be:

/*****************************************************
 * Magic Mirror                                      *
 * Custom CSS                                        *
 *                                                   *
 * By Michael Teeuw http://michaelteeuw.nl           *
 * MIT Licensed.                                     *
 *                                                   *
 * Add any custom CSS below.                         *
 * Changes to this files will be ignored by GIT. *
 *****************************************************/

body {
  /* only things you want to change on the 'body' element (eg: background: red;) */
}

.MMM-RTSPStream .innerWrapper {
  margin: 0px;
}

Theoretically, you don't need to restart the container, if you change the css. You only need to restart the container, if you change the config.js file or add a new module into the modules folder.

dersch81 commented 6 years ago

Ok now i got it! Thanks a lot :)