Read the statement by Michael Teeuw here.
Magic mirror dual screen
-
@sdetweil see the pm2_MagicMirror.json in ~/MagicMirror/installers
copy, change the name and script name, make a new script mm2.sh
and the env variablepm2 start pm2_MagicMirror.json(new name)
pm2 savethat give the app pm2 manages a pretty name
you can test w another terminal window
set the env variable, using export variable=
then create the new config.js, w only the modules u want enabled.
then npm start -
-
@BKeyport What I did was two directories, with seperate configs, then mm.sh does:
cd /home/bkey1970/MagicMirror DISPLAY=:0 npm start
and mm2.sh does:
cd /home/bkey1970/MagicMirror2 DISPLAY=:0 npm start
To get the 2nd on the 2nd monitor, I added:
electronOptions: { x: 1920 },
to the 2nd config.js, right below the address line, and changed the port to 8081.
-
copy the second config.js to the first mm config directory as config2.js
edit the mm2.sh
cd to the first mm directory(instead of the second)
and add a lineexport MM_CONFIG_FILE=${cwd}/config/config2.js
npm startnow. make sure all the modules needed by both instances are installed in the modules folder of the 1st instance.
if they aren’t used by a particular instance, no big deal, same as setting disabled:true on a module config
-
Interesting - although, now, it’s ignoring the
electronOptions:
item. -
Here’s the answer for @1a2a3a (Edited to show below changes)
Here’s how to do it cleanly: (replace
<username>
with your pi login name., with width of first monitor)- create two starting scripts:
First,
mm.sh
is as follows:cd /home/<username>/MagicMirror DISPLAY=:0 npm start
Second,
mm2.sh
is as follows:cd /home/<username>/MagicMirror export MM_CONFIG_FILE=${pwd}/config/config2.js DISPLAY=:0 npm start
- Two config files in magicmirror/config next:
First,
config.js
(this is your second monitor):var config = { electronOptions: { x: <width> }, address: "0.0.0.0", port: 8080, ipWhitelist: [], language: "en", timeFormat: 12, units: "imperial", //logLevel: ["INFO", "LOG", "WARN", "ERROR", "DEBUG"], modules: [ ...
Second
config2.js
(this is your first monitor):var config = { address: "0.0.0.0", port: 8081, ipWhitelist: [], language: "en", timeFormat: 12, units: "imperial", //logLevel: ["INFO", "LOG", "WARN", "ERROR", "DEBUG"], modules: [ ...
electronOptions will only work in the file that isn’t redirected to a new config - so use that in the
config.js
only. -
@BKeyport nice description
-
@sdetweil I figured I might as well make it as clear as possible…
-
Thanks all! I’ll give this a go once the monitor arrives!
-