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.

    Is it possible to change the CSS layout at a certain time? (Dark Mode)

    Scheduled Pinned Locked Moved Development
    11 Posts 6 Posters 3.8k Views 6 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 Offline
      sdetweil @mopedmann
      last edited by

      @mopedmann there is no api to do that, but I can imagine a node helper swapping custom.css files and causing a page reload…

      Sam

      How to add modules

      learning how to use browser developers window for css changes

      1 Reply Last reply Reply Quote 0
      • F Offline
        Foxy25
        last edited by

        Hi

        maybe it is possible to write a script that rename the used .css in another filename (from custom.css to Custom.1) an after that, rename an other .css to custom.css. Packed this in an cronjob an you have a change of the .css files. After the rename routine restart the mirror…

        Not the elegant way, but it can work’s.

        Another Idea: Is ist possible to dimm the Display via a cronjob ?

        Grettings Torsten

        M 1 Reply Last reply Reply Quote 1
        • M Offline
          mopedmann
          last edited by

          Hi @sdetweil @Foxy25
          thanks a lot for the quick and great answers!
          However, I’m a total beginner in programming and am shambling through previous solutions on the forum to implement something in the same way.
          So if someone has time and desire to develop a dark mode/css switch for the Magic Mrror this would be great.

          KamiSchamiK F 2 Replies Last reply Reply Quote 0
          • KamiSchamiK Offline
            KamiSchami @mopedmann
            last edited by

            @mopedmann

            … otherwise you can also have the display dimmed temporarily

            Real programmers never work 9 to 5. If they are around at 9 AM, it's because they were up all night.

            1 Reply Last reply Reply Quote 0
            • F Offline
              Foxy25 @mopedmann
              last edited by

              @mopedmann

              Its not that hard as it seems.

              A handfull of code that you have to write.

              A good task to learn a bit about bash programming under linux.

              Try the fist step, it would be helpful for the future…

              Greetings Torsten

              1 Reply Last reply Reply Quote 1
              • E Offline
                ember1205
                last edited by

                This is an interesting idea, and I found this write-up that I thought was interesting.

                https://labs.tadigital.com/index.php/2020/04/10/night-and-day-switch-using-css-variables/

                1 Reply Last reply Reply Quote 0
                • M Offline
                  mopedmann
                  last edited by

                  Thank you for all the ideas and advice. I will report when I have made first progress
                  With kind regards
                  mopedman

                  1 Reply Last reply Reply Quote 0
                  • Piranha1605P Offline
                    Piranha1605
                    last edited by

                    I hope this help.

                    https://github.com/Piranha1605/MMM-CSSswitch

                    1 Reply Last reply Reply Quote 2
                    • M Offline
                      mopedmann @Foxy25
                      last edited by

                      Hey everyone,
                      yesterday I have implemented the idea of Foxy25 and it works great.
                      @foxy25 said in Is it possible to change the CSS layout at a certain time? (Dark Mode):

                      Hi

                      maybe it is possible to write a script that rename the used .css in another filename (from custom.css to Custom.1) an after that, rename an other .css to custom.css. Packed this in an cronjob an you have a change of the .css files. After the rename routine restart the mirror…

                      Piranha1605’s solution looks even better and easier!
                      @piranha1605 said in Is it possible to change the CSS layout at a certain time? (Dark Mode):

                      I hope this help.

                      https://github.com/Piranha1605/MMM-CSSswitch

                      Thanks for the great help

                      F 1 Reply Last reply Reply Quote 0
                      • F Offline
                        Foxy25 @mopedmann
                        last edited by

                        @mopedmann

                        Hi, the Css-Switcher is really the more comfortable way to do the change!

                        but, you don’t learn the basics of coding ;-)

                        Anyway, good to hear that it works in both ways.

                        Greetings Foxy

                        1 Reply Last reply Reply Quote 0
                        • 1
                        • 2
                        • 2 / 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