Config, Modules, and custom CSS
After the first start of the container you find 3 directories
~/magicmirror/mounts/config
~/magicmirror/mounts/modules
~/magicmirror/mounts/css
config
contains the config.js
, you find more information here.
You can also use a config.js.template
instead which can contain environment variables (this is not possible in config.js
). This make sense for keeping secrets (e.g. passwords, api keys) out of the config file. In config.js.template
you can use shell variable syntax e.g. ${MY_SECRET}
as placeholder for your secrets. Don't forget to pass variables in config.js.template
as environment variables to the container:
environment:
MY_SECRET: "abc"
You can also use the .env
file (in the same directory as your compose.yaml
) to define your secrets there, for more info on this see the docker compose reference.
👉 When the container starts, the
config.js
will be created using theconfig.js.template
. An existingconfig.js
will be overwritten and saved asconfig.js-old
For installing modules refer to the module website, the default modules are described here.
There is one difference installing or updating modules compared to a standard setup: You must do the
git clone ...
,git pull
andnpm install
commands from inside the running docker container. For this you executedocker exec -it mm bash
and in this shell you navigate to themodules/MMM-...
folder. For exiting from the container you typeexit
.
css
contains the custom.css
file, which you can use to override your modules' appearance. CSS basics are documented here, among many other places.
👉 The css-files in the
css
folder which exists in the MagicMirror² git repo (currently onlymain.css
) are overriden with the original file from inside the container with every restart. So if you need to change this file, you must stop this default copying by setting the environment variableMM_OVERRIDE_CSS
tofalse
in the.env
file:
MM_OVERRIDE_CSS="false"
Default Modules
The default modules of MagicMirror² are located in the folder ~/magicmirror/mounts/modules
. These modules are maintained in the MagicMirror² project and not - as other modules - in own git repositories. So if they are mounted the first time outside the container this version remains on the host and would never updated again. To prevent this, the docker container overrides the default
modules folder with the versions from inside the container.
If someone does not agree with this procedure he can avoid the copy process by setting the environment variable MM_OVERRIDE_DEFAULT_MODULES
to false
in the .env
file:
MM_OVERRIDE_DEFAULT_MODULES="false"
Timezone
The container tries to get the timezone by location. If this is not possible or wrong, you can set the timezone to a different value by editing the compose.yaml
file. You have to add the timezone as environment variable:
environment:
TZ: Europe/Berlin
Mouse cursor
The mouse cursor is diabled by default. You can enable it by setting the environment variable MM_SHOW_CURSOR
to true
in your .env
file:
MM_SHOW_CURSOR="true"