MagicMirror Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • Donate
    • Discord

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

    Development
    6
    11
    751
    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.
    • M
      mopedmann last edited by

      Hey everyone,
      is it possible to change the CSS layout at a certain time?
      At the moment I use the Bright UI from Piranha1605.
      However, in the evening this is too bright and I would like to change to the Dark UI from Piranha1605.
      I would be very pleased to receive an answer.
      With kind regards
      mopedmann

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

        Create a working config
        How to add modules

        1 Reply Last reply Reply Quote 0
        • F
          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
            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.

            KamiSchami F 2 Replies Last reply Reply Quote 0
            • KamiSchami
              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
                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
                  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
                    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
                    • Piranha1605
                      Piranha1605 last edited by

                      I hope this help.

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

                      1 Reply Last reply Reply Quote 2
                      • M
                        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
                        • 1
                        • 2
                        • 1 / 2
                        • First post
                          Last post
                        Enjoying MagicMirror? Please consider a donation!
                        MagicMirror created by Michael Teeuw.
                        Forum managed by Paul-Vincent Roll and Rodrigo Ramírez Norambuena.
                        This forum is using NodeBB as its core | Contributors
                        Contact | Privacy Policy