<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Change layout based on orientation?]]></title><description><![CDATA[<p dir="auto">I’ve had my mirror in a portrait for a long time. I was thinking of playing around with changing it to landscape and started wondering if i was possible to have the layout change based on browser orientation. I know there’s CSS that can be used to move things around based on orientation (<a href="https://developer.mozilla.org/en-US/docs/Web/CSS/@media/orientation" target="_blank" rel="noopener noreferrer nofollow ugc">https://developer.mozilla.org/en-US/docs/Web/CSS/@media/orientation</a>) , but I was wondering if there was any way to use that to actually move which modules were in what region.</p>
]]></description><link>https://forum.magicmirror.builders/topic/19480/change-layout-based-on-orientation</link><generator>RSS for Node</generator><lastBuildDate>Mon, 20 Jul 2026 16:23:11 GMT</lastBuildDate><atom:link href="https://forum.magicmirror.builders/topic/19480.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 01 Mar 2025 19:19:42 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Change layout based on orientation? on Sat, 01 Mar 2025 21:37:41 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/gonzonia" aria-label="Profile: gonzonia">@<bdi>gonzonia</bdi></a> sameo</p>
]]></description><link>https://forum.magicmirror.builders/post/124412</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/124412</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Sat, 01 Mar 2025 21:37:41 GMT</pubDate></item><item><title><![CDATA[Reply to Change layout based on orientation? on Sat, 01 Mar 2025 21:31:21 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sdetweil" aria-label="Profile: sdetweil">@<bdi>sdetweil</bdi></a> I’m going to make it more dynamic. There’s actually screen.orientation.type that works to get landscape vs portrait</p>
]]></description><link>https://forum.magicmirror.builders/post/124411</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/124411</guid><dc:creator><![CDATA[gonzonia]]></dc:creator><pubDate>Sat, 01 Mar 2025 21:31:21 GMT</pubDate></item><item><title><![CDATA[Reply to Change layout based on orientation? on Sat, 01 Mar 2025 21:18:56 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/gonzonia" aria-label="Profile: gonzonia">@<bdi>gonzonia</bdi></a> all you need is a<br />
notificationReceived<br />
“DOM_OBJECTS_CREATED”<br />
if the width is greater than the height its landscape<br />
then loop thru the config</p>
]]></description><link>https://forum.magicmirror.builders/post/124410</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/124410</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Sat, 01 Mar 2025 21:18:56 GMT</pubDate></item><item><title><![CDATA[Reply to Change layout based on orientation? on Sat, 01 Mar 2025 21:05:11 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sdetweil" aria-label="Profile: sdetweil">@<bdi>sdetweil</bdi></a> Maybe. I find it easier to build on someone else’s code. After I have some basic stuff functioning, I’ll look for a module template to work from. I’m also not sure the dynamic module will work (it’s 7 years old) so it might need to be updated anyhow.</p>
]]></description><link>https://forum.magicmirror.builders/post/124409</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/124409</guid><dc:creator><![CDATA[gonzonia]]></dc:creator><pubDate>Sat, 01 Mar 2025 21:05:11 GMT</pubDate></item><item><title><![CDATA[Reply to Change layout based on orientation? on Sat, 01 Mar 2025 20:49:44 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/gonzonia" aria-label="Profile: gonzonia">@<bdi>gonzonia</bdi></a> create your own module</p>
<p dir="auto">send the notifications when it matters</p>
<p dir="auto">lot easier</p>
]]></description><link>https://forum.magicmirror.builders/post/124408</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/124408</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Sat, 01 Mar 2025 20:49:44 GMT</pubDate></item><item><title><![CDATA[Reply to Change layout based on orientation? on Sat, 01 Mar 2025 20:17:06 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sdetweil" aria-label="Profile: sdetweil">@<bdi>sdetweil</bdi></a> That’s a thought. I think I can probably adapt the Dynamic Modules to allow for a config option to adjust based on orientation and that gets triggered at the ALL_MODULES_STARTED notification from the core.</p>
<p dir="auto">Let me fork that and see if I can make that work.</p>
]]></description><link>https://forum.magicmirror.builders/post/124407</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/124407</guid><dc:creator><![CDATA[gonzonia]]></dc:creator><pubDate>Sat, 01 Mar 2025 20:17:06 GMT</pubDate></item><item><title><![CDATA[Reply to Change layout based on orientation? on Sat, 01 Mar 2025 20:14:52 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/gonzonia" aria-label="Profile: gonzonia">@<bdi>gonzonia</bdi></a>  or start a different instance on a different port for landscape</p>
]]></description><link>https://forum.magicmirror.builders/post/124406</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/124406</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Sat, 01 Mar 2025 20:14:52 GMT</pubDate></item><item><title><![CDATA[Reply to Change layout based on orientation? on Sat, 01 Mar 2025 20:11:49 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/gonzonia" aria-label="Profile: gonzonia">@<bdi>gonzonia</bdi></a> there is a moduke that can<br />
move dynamically<br />
<a href="https://github.com/Toreke/MMM-Dynamic-Modules" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/Toreke/MMM-Dynamic-Modules</a></p>
<p dir="auto">but it needs notifications</p>
]]></description><link>https://forum.magicmirror.builders/post/124405</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/124405</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Sat, 01 Mar 2025 20:11:49 GMT</pubDate></item><item><title><![CDATA[Reply to Change layout based on orientation? on Sat, 01 Mar 2025 20:06:21 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sdetweil" aria-label="Profile: sdetweil">@<bdi>sdetweil</bdi></a> Yeah the challenge I’m having with the way I’ve chosen to lay things out is that I have things in the top left, top center, and top right. They are just below things in the top bar on the vertical screen. Using the CSS from the post that shifts them They are still below the top bar but I kind of want them to the right of the top bar. I’m plying with it to see what I can do, but since they are all part of the same container, I’m not sure I can.</p>
]]></description><link>https://forum.magicmirror.builders/post/124404</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/124404</guid><dc:creator><![CDATA[gonzonia]]></dc:creator><pubDate>Sat, 01 Mar 2025 20:06:21 GMT</pubDate></item><item><title><![CDATA[Reply to Change layout based on orientation? on Sat, 01 Mar 2025 19:57:49 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/gonzonia" aria-label="Profile: gonzonia">@<bdi>gonzonia</bdi></a> yeh screen shifting is different than module shifting</p>
<p dir="auto">you can certainly detect the orientation in css</p>
<p dir="auto">on another app i support</p>
<pre><code class="language-css">
:root{
  --scale-factor: 1;  /* set default scaling in case we have partial window, debug or in vm terminal window */
  --design-width: 1920px;
  --design-height: 1080px;
}

@media screen and (orientation: landscape) {
    :root{
        --scale-factor: var(width) / var(--design-width);
     };
 }
 @media screen and (orientation: portrait) {
    :root{
        --scale-factor: var(width) / var(--design-height);
     };
 }

/*@media screen and (width:3840px)  and (orientation: landscape) {
    :root{
    --scale-factor: width/var(--design-width);

    };
}
@media  screen and (width:1080px)   {
    :root{
    --scale-factor: width/var(--design-width);
    };
}*/
</code></pre>
]]></description><link>https://forum.magicmirror.builders/post/124403</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/124403</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Sat, 01 Mar 2025 19:57:49 GMT</pubDate></item><item><title><![CDATA[Reply to Change layout based on orientation? on Sat, 01 Mar 2025 19:48:25 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sdetweil" aria-label="Profile: sdetweil">@<bdi>sdetweil</bdi></a> That’s on the server side though. I was thinking more at the client side, so that you could have multiple clients using a single server with different views.<br />
For example:<br />
I have a pi hooked up to a monitor in the kitchen running MM in portrait.</p>
<p dir="auto">It might be nice to have it up on the TV in another room or on a second monitor while I’m working. Those will be in landscape.</p>
<p dir="auto">I think it can be done with shifting CSS mostly(<a href="https://forum.magicmirror.builders/topic/13197/change-the-regions-positions">https://forum.magicmirror.builders/topic/13197/change-the-regions-positions</a>). But modules that use full screen might be a challenge.</p>
]]></description><link>https://forum.magicmirror.builders/post/124402</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/124402</guid><dc:creator><![CDATA[gonzonia]]></dc:creator><pubDate>Sat, 01 Mar 2025 19:48:25 GMT</pubDate></item><item><title><![CDATA[Reply to Change layout based on orientation? on Sat, 01 Mar 2025 19:47:06 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/gonzonia" aria-label="Profile: gonzonia">@<bdi>gonzonia</bdi></a> modules are hard coded to position.</p>
<p dir="auto">while the exact location and size changes by device orientation<br />
the logical placement is the same</p>
<p dir="auto">you could create another config.js or make those variables<br />
and use the envsub/template support to change the variable definitions in the script that starts MagicMirror</p>
<p dir="auto">using older xrandr</p>
<pre><code class="language-sh">#!/bin/bash

orientation=$(xrandr | grep " connected" | awk '{print $2 " " $3 " " $4}')

if [[ $orientation == *"left"* ]]; then
  echo "Screen orientation: left"
elif [[ $orientation == *"right"* ]]; then
  echo "Screen orientation: right"
elif [[ $orientation == *"inverted"* ]]; then
  echo "Screen orientation: inverted"
else
  echo "Screen orientation: normal"
fi

</code></pre>
<p dir="auto">see <a href="https://docs.magicmirror.builders/configuration/introduction.html#configuration-template-system" target="_blank" rel="noopener noreferrer nofollow ugc">https://docs.magicmirror.builders/configuration/introduction.html#configuration-template-system</a></p>
]]></description><link>https://forum.magicmirror.builders/post/124401</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/124401</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Sat, 01 Mar 2025 19:47:06 GMT</pubDate></item></channel></rss>