MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    Magic mirror dual screen

    Scheduled Pinned Locked Moved General Discussion
    25 Posts 4 Posters 23.3k Views 4 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S Do not disturb
      sdetweil @sdetweil
      last edited by sdetweil

      @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 variable

      pm2 start pm2_MagicMirror.json(new name)
      pm2 save

      that 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

      Sam

      How to add modules

      learning how to use browser developers window for css changes

      BKeyportB 1 Reply Last reply Reply Quote 0
      • BKeyportB Offline
        BKeyport Module Developer @sdetweil
        last edited by

        @sdetweil heck, I’m a little lost there. Can you explain it out a bit better for us? I’m currently running two Magicmirrors back to back with two MM Directories and custom mm.sh files, if I could simplify that, I want to.

        BKeyportB 1 Reply Last reply Reply Quote 0
        • BKeyportB Offline
          BKeyport Module Developer @BKeyport
          last edited by BKeyport

          @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.

          S 1 Reply Last reply Reply Quote 0
          • S Do not disturb
            sdetweil @BKeyport
            last edited by

            @BKeyport @1a2a3a

            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 line

            export MM_CONFIG_FILE=${cwd}/config/config2.js
            npm start

            now. 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

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            BKeyportB 1 Reply Last reply Reply Quote 0
            • BKeyportB Offline
              BKeyport Module Developer @sdetweil
              last edited by

              Interesting - although, now, it’s ignoring the electronOptions: item.

              BKeyportB 1 Reply Last reply Reply Quote 0
              • BKeyportB Offline
                BKeyport Module Developer @BKeyport
                last edited by BKeyport

                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)

                1. 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
                
                1. 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.

                S 1 Reply Last reply Reply Quote 1
                • S Do not disturb
                  sdetweil @BKeyport
                  last edited by

                  @BKeyport nice description

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

                  BKeyportB 1 Reply Last reply Reply Quote 0
                  • BKeyportB Offline
                    BKeyport Module Developer @sdetweil
                    last edited by

                    @sdetweil I figured I might as well make it as clear as possible…

                    1 Reply Last reply Reply Quote 1
                    • 1 Offline
                      1a2a3a
                      last edited by

                      Thanks all! I’ll give this a go once the monitor arrives!

                      S 1 Reply Last reply Reply Quote 0
                      • S Do not disturb
                        sdetweil @1a2a3a
                        last edited by

                        @1a2a3a @BKeyport

                        the MM_CONFIG_FILE problem is mine

                        the correct stmt would be

                        export MM_CONFIG_FILE=$(pwd)/config/config2.js
                        

                        notice I changed the brackets to parens and changed the command name

                        Sam

                        How to add modules

                        learning how to use browser developers window for css changes

                        BKeyportB 2 Replies Last reply Reply Quote 0
                        • BKeyportB Offline
                          BKeyport Module Developer @sdetweil
                          last edited by

                          This post is deleted!
                          S 1 Reply Last reply Reply Quote 0
                          • S Do not disturb
                            sdetweil @BKeyport
                            last edited by

                            @BKeyport I just fixed it

                            Sam

                            How to add modules

                            learning how to use browser developers window for css changes

                            1 Reply Last reply Reply Quote 0
                            • BKeyportB Offline
                              BKeyport Module Developer @sdetweil
                              last edited by

                              It has to be brackets on my system, FYI.

                              S 1 Reply Last reply Reply Quote 0
                              • S Do not disturb
                                sdetweil @BKeyport
                                last edited by

                                @BKeyport ok…

                                Sam

                                How to add modules

                                learning how to use browser developers window for css changes

                                1 Reply Last reply Reply Quote 0
                                • 1 Offline
                                  1a2a3a
                                  last edited by

                                  btw, how do i configure the css for the 2 screen?

                                  S 1 Reply Last reply Reply Quote 0
                                  • S Do not disturb
                                    sdetweil @1a2a3a
                                    last edited by sdetweil

                                    @1a2a3a you would set the css filename in its config.js

                                    so you would have css/custom.css and css/custom2.css, one for each instance

                                    from the doc
                                    https://docs.magicmirror.builders/configuration/introduction.html

                                    customCss	The path of the custom.css stylesheet. The default is css/custom.css.
                                    

                                    Sam

                                    How to add modules

                                    learning how to use browser developers window for css changes

                                    BKeyportB 1 Reply Last reply Reply Quote 0
                                    • BKeyportB Offline
                                      BKeyport Module Developer @sdetweil
                                      last edited by

                                      @sdetweil alternatively, use the single custom.css file if there’s no conflict.

                                      S 1 Reply Last reply Reply Quote 0
                                      • S Do not disturb
                                        sdetweil @BKeyport
                                        last edited by

                                        @BKeyport yeh but I assumed there was a conflict, else he wouldn’t have known there was an issue.

                                        Sam

                                        How to add modules

                                        learning how to use browser developers window for css changes

                                        1 Reply Last reply Reply Quote 0
                                        • 1 Offline
                                          1a2a3a
                                          last edited by

                                          Decided to drop this for now guys. The new monitor is a 27 qhd compared to the previous 24 fhd. With the extra real estate, everything doesn’t seems to be so cluttered now.

                                          1 Reply Last reply Reply Quote 1

                                          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
                                          • 1
                                          • 2
                                          • 1 / 2
                                          • First post
                                            Last post
                                          Enjoying MagicMirror? Please consider a donation!
                                          MagicMirror created by Michael Teeuw.
                                          Forum managed by Sam, technical setup by Karsten.
                                          This forum is using NodeBB as its core | Contributors
                                          Contact | Privacy Policy