Read the statement by Michael Teeuw here.
Two Display
-
@saljoke
Hi. Thats right. i only use 1 Pi4 to serve both displays via 2 MM instances. first the originally MagicMirror directory and the second in a MagicMirror2 directory. Both powered up via PM2 and turned off and on via PIR sensor.The config looks like this:
language: “de”,
logLevel: [“INFO”, “LOG”, “WARN”, “ERROR”],
timeFormat: 24,
units: “metric”,
electronOptions: {fullscreen:true, x:1920},1920 is the resolution witdh of the main display.
Very easy to handle and good for the electrical consumption
-
@krocaq AND you can do it with ONE directory, by using the
environment variable
for one instance
MM_CONFIG_FILE=config/config.js
for the other
MM_CONFIG_FILE=config/config2.js
(each on a different port, same as what u have now)and install all the modules in the modules folder for both,
only those used by an instance will be loadedin each config you can also use different custom.css files…
so each instance can present a different view -
S sdetweil referenced this topic on
-
@sdetweil Hello,
How to setup the environnent variable and custom css for that?
Do you have any tutorial/guide i can use? -
@lexcyr in windows u set env var with
set varname=value
in Linux it’s
varname=value
but if you are starting another program from the script, you need to do
export varname=value
the css name is specified in the config.js
see the config instructions
https://docs.magicmirror.builders/configuration/introduction.html -
@sdetweil Thanks for the info.
But i think i wasn’t clear enough with my question.
I was asking how to setup your MM, and use ONE directory and have different config for 2 display.
From what you said it can be made by using environment variable. -
create two config files
config.js
and
config2.js
this one has the left:1920 to move to the second display
has 3 instances of calendarin the installers/mm.sh
# select the 1st config file
export MM_CONFIG_FILE=config/config.js
# detaches the process so we can continue
npm start &#select the second config file
export MM_CONFIG_FILE=config/config2.js
npm startin each config.js file you can point to different custom.css
using the customCSS: ??? path/nameeach instance has to use a different port or course
-
@sdetweil Thanks a lot. It works well.
I have another question. is it possible to do the same, but only have one of the mirror config displaying on electron browser and the other one working as server to be displayed with any other browser from another device?
like this:- 1st interface with config1 launch localy from electron browser with
-2nd interface with config2 work as server mode and launch from another device browser
i’ve tried to just change the second section in the mm.sh file from “npm start” to “npm server”, but unfortunately it’s not working and everything just freezing.
PS: i am running MM on Linux Lite 6.0
- 1st interface with config1 launch localy from electron browser with
-
yes but its
npm run servernot npm server
only the start clause
npm startallows use without ‘run’
-
@sdetweil thanks a lot, it works.
-
How to setup the environnent variable and custom css for that?
Do you have any tutorial/guide i can use? -
@rubelahamed see this post
https://forum.magicmirror.builders/topic/17239/two-display/5?_=1665163023943customCss is a config Parm in config.js
see
https://docs.magicmirror.builders/configuration/introduction.html -
Maybe a noobish question but why isn’t possible to run magicmirror and display it over 2 screens.
So that you can say like module x on display 1 and module y on display 2 for example through a JS class?? -
@MarkV well you ‘can’, but you have to do it manually, drag the mm window over both screens. but maximize will only do one screen. same on windows.
where the module is displayed depends on the css structure. the ‘position’ is a predefined area in main.css, the module returns a blob of content (html div) and the mm runtime injects the content into its configured location
-
@sdetweil
Oh oke. But on windows you can also expand the desktop en have some things start on one en other thongs on the second screen…
To bad that you have to drag them this would be one of the best addons for MMM -
@MarkV u can change the MM config and have it start on the second screen…
add (after the address: config )
electronOptions: { x: ????? },where xxx is the width of your 1st display
or y: ??? if vertical
you can also run two instances of MM from the same folder with different configurations on different ports
drag is to make ONE BIG MM across BOTH screens
the maximize function only does ONE screen…
open chrome on any screen, hit maximize button…
nothing we can do
-
G grantc66 referenced this topic on
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login