Skip to content

MMPM Environment Variables

Brandon Marlowe edited this page Jul 25, 2020 · 19 revisions

You can view your current settings by running mmpm env, or opening the Control Center of the GUI. The variables can be changed by running mmpm open --env, or using Config Editor of the GUI.

The environment variables are defined in a JSON file named ~/.config/mmpm/mmpm-env.json to allow for hot-reloading configuration changes in GUI.

Remember, you cannot put comments in mmpm-env.json.

MMPM_MAGICMIRROR_ROOT

Set this to the absolute path of the root directory of your MagicMirror installation, for example: /home/pi/MagicMirror

If you have multiple MagicMirror installations on the same device, you can switch between them by modifying this value.

MMPM_MAGICMIRROR_URI

Set this to the IP address of the MagicMirror installation, ie. http://192.168.0.15:8080.

Do not use the default http://localhost:8080

This environment variable is required to hide/show MagicMirror modules.

See Status/Hide/Show for setup.

If you are using MagicMirror with docker-compose, and attempting to hide/show or see the status of enabled modules, you will need to open MagicMirror in a browser at the MMPM_MAGICMIRROR_URI address to activate the websocket connection between MMPM and MagicMirror.

Additionally, the MMPM MagicMirror module will need to be installed to activate this feature.

The MMPM MagicMirror module can be installed from the Control Center on the GUI, or through the CLI with mmpm install --as-module

MMPM_MAGICMIRROR_PM2_PROCESS_NAME

If you are using pm2 to manage the on/off state of MagicMirror, set this to the process name being used. If you are not using pm2, leave this as an empty string.

Do not set both MMPM_MAGICMIRROR_PM2_PROCESS_NAME and MMPM_MAGICMIRROR_DOCKER_COMPOSE_FILE. This will cause undefined behavior.

MMPM_MAGICMIRROR_DOCKER_COMPOSE_FILE

If you have installed MagicMirror using docker-compose, set this to the absolute path of the docker-compose.yml file associated with MagicMirror. If you are not using MagicMirror with docker-compose, leave this as an empty string.

MMPM_IS_DOCKER_IMAGE

If you are using the Docker/docker-compose version of MMPM, set this to true, otherwise, leave this false as shown in the examples below.

If this is set to true, leave MMPM_MAGICMIRROR_DOCKER_COMPOSE_FILE and MMPM_MAGICMIRROR_PM2_PROCESS_NAME as empty strings.

The MMPM Docker image cannot control MagicMirror through docker-compose, pm2, or npm.

Example Configuration Using docker-compose for Managing MagicMirror

{
  "MMPM_MAGICMIRROR_ROOT": "/home/pi/MagicMirror",
  "MMPM_MAGICMIRROR_URI": "http://192.168.0.15:8080",
  "MMPM_MAGICMIRROR_PM2_PROCESS_NAME": "",
  "MMPM_MAGICMIRROR_DOCKER_COMPOSE_FILE": "/home/pi/docker/magicmirror/docker-compose.yml",
  "MMPM_IS_DOCKER_IMAGE": false
}

Example Configuration Using PM2 for Managing MagicMirror

{
  "MMPM_MAGICMIRROR_ROOT": "/home/pi/MagicMirror",
  "MMPM_MAGICMIRROR_URI": "http://192.168.0.15:8080",
  "MMPM_MAGICMIRROR_PM2_PROCESS_NAME": "MagicMirror",
  "MMPM_MAGICMIRROR_DOCKER_COMPOSE_FILE": "",
  "MMPM_IS_DOCKER_IMAGE": false
}

Example Configuration Using NPM for Managing MagicMirror

{
  "MMPM_MAGICMIRROR_ROOT": "/home/pi/MagicMirror",
  "MMPM_MAGICMIRROR_URI": "http://192.168.0.15:8080",
  "MMPM_MAGICMIRROR_PM2_PROCESS_NAME": "",
  "MMPM_MAGICMIRROR_DOCKER_COMPOSE_FILE": "",
  "MMPM_IS_DOCKER_IMAGE": false
}

Example Configuration Using the MMPM Docker Image

{
  "MMPM_MAGICMIRROR_ROOT": "/home/pi/MagicMirror",
  "MMPM_MAGICMIRROR_URI": "http://192.168.0.15:8080",
  "MMPM_MAGICMIRROR_PM2_PROCESS_NAME": "",
  "MMPM_MAGICMIRROR_DOCKER_COMPOSE_FILE": "",
  "MMPM_IS_DOCKER_IMAGE": true
}

Clone this wiki locally