<?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[Save performance when rotating screen e.g. on Raspberry Pi]]></title><description><![CDATA[<h2>Rotating the screen through custom css (saving performance)</h2>
<p dir="auto">Hello guys,</p>
<p dir="auto">if you’re running on low end hardware e.g. Raspberry Pi and want to rotate the screen you can rotate it with a custom css file, thus saving precious performance!</p>
<p dir="auto">Copy paste this code to your custom.css file for a screen rotation of 90degrees:</p>
<pre><code> body {
        margin: 0;
	position: absolute;
 	transform: rotate(90deg);
 	transform-origin: bottom left;
	width: 100vh;
	height: 100vw;
	object-fit: cover;
	top: -100vw;
        visibility: visible;
 }
</code></pre>
<p dir="auto">Copy paste this code to your custom.css file for a screen rotation of -90degrees:</p>
<pre><code> body {
	margin: 0;
	position: absolute;
 	transform: rotate(-90deg);
 	transform-origin: top left; 
	width: 100vh;
	height: 100vw;
	object-fit: cover;
	top: 100vh;
        visibility: visible;
 }
</code></pre>
<p dir="auto">Also note that you may have to switch back framebuffer_width and framebuffer_height in your /boot/config.txt file as stated by evroom <a href="https://forum.magicmirror.builders/post/51859">here</a>, e.g.:</p>
<pre><code>framebuffer_width=1600
framebuffer_height=900
</code></pre>
<p dir="auto">Drawbacks:</p>
<ul>
<li>since it only rotates the magic mirror app, external apps like omxplayer have to be rotated seperately</li>
<li>you may have to edit the css file of some modules as well</li>
</ul>
<p dir="auto">This could be added to the wiki <a href="https://github.com/MichMich/MagicMirror/wiki/configuring-the-raspberry-pi" target="_blank" rel="noopener noreferrer nofollow ugc">here</a>.</p>
]]></description><link>https://forum.magicmirror.builders/topic/9707/save-performance-when-rotating-screen-e-g-on-raspberry-pi</link><generator>RSS for Node</generator><lastBuildDate>Sat, 09 May 2026 23:15:08 GMT</lastBuildDate><atom:link href="https://forum.magicmirror.builders/topic/9707.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 05 Feb 2019 16:32:59 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Save performance when rotating screen e.g. on Raspberry Pi on Sat, 09 Oct 2021 17:23:47 GMT]]></title><description><![CDATA[<p dir="auto">Hi there! thanks for the easy fix! Is there a way to reposition the modules on the mirror? when I rotate the screen 90 degrees the bottom module (the newsfeed) its completely cut out.</p>
]]></description><link>https://forum.magicmirror.builders/post/95402</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/95402</guid><dc:creator><![CDATA[floydrexdime]]></dc:creator><pubDate>Sat, 09 Oct 2021 17:23:47 GMT</pubDate></item><item><title><![CDATA[Reply to Save performance when rotating screen e.g. on Raspberry Pi on Wed, 28 Oct 2020 07:17:46 GMT]]></title><description><![CDATA[<p dir="auto">Thank you <a class="plugin-mentions-user plugin-mentions-a" href="/user/ptrk95" aria-label="Profile: ptrk95">@<bdi>ptrk95</bdi></a>, that just came in handy while playing around with fullpageos and the magic mirror in my docker setup!</p>
]]></description><link>https://forum.magicmirror.builders/post/84013</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/84013</guid><dc:creator><![CDATA[Goeste]]></dc:creator><pubDate>Wed, 28 Oct 2020 07:17:46 GMT</pubDate></item><item><title><![CDATA[Reply to Save performance when rotating screen e.g. on Raspberry Pi on Sun, 18 Oct 2020 01:33:08 GMT]]></title><description><![CDATA[<p dir="auto">Never mind guys I was able to get it to work by following the instructions <a href="https://github.com/MichMich/MagicMirror/wiki/Configuring-the-Raspberry-Pi" target="_blank" rel="noopener noreferrer nofollow ugc">here</a><br />
After all it wasn’t the css file that I needed to change, but the Pi autostart file in the /etc/xdg/lxsession/LXDE-pi/ folder.</p>
]]></description><link>https://forum.magicmirror.builders/post/83649</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/83649</guid><dc:creator><![CDATA[hdez]]></dc:creator><pubDate>Sun, 18 Oct 2020 01:33:08 GMT</pubDate></item><item><title><![CDATA[Reply to Save performance when rotating screen e.g. on Raspberry Pi on Sat, 17 Oct 2020 14:44:29 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> Thanks. Next time.</p>
]]></description><link>https://forum.magicmirror.builders/post/83611</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/83611</guid><dc:creator><![CDATA[hdez]]></dc:creator><pubDate>Sat, 17 Oct 2020 14:44:29 GMT</pubDate></item><item><title><![CDATA[Reply to Save performance when rotating screen e.g. on Raspberry Pi on Sat, 17 Oct 2020 02:03:43 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/hdez" aria-label="Profile: hdez">@<bdi>hdez</bdi></a> said in <a href="/post/83592">Save performance when rotating screen e.g. on Raspberry Pi</a>:</p>
<blockquote>
<p dir="auto">(sorry, I don’t know how to put this in a separate box</p>
</blockquote>
<p dir="auto">after you paste the text, select it, and then push the button above the editor that looks like &lt;/&gt;</p>
]]></description><link>https://forum.magicmirror.builders/post/83593</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/83593</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Sat, 17 Oct 2020 02:03:43 GMT</pubDate></item><item><title><![CDATA[Reply to Save performance when rotating screen e.g. on Raspberry Pi on Sat, 17 Oct 2020 01:25:41 GMT]]></title><description><![CDATA[<p dir="auto">Warning! Extreme newbie here. This is only my second day playing with Magic Mirror css.</p>
<p dir="auto">I changed my css file and boot/config.txt following <a class="plugin-mentions-user plugin-mentions-a" href="/user/evroom" aria-label="Profile: evroom">@<bdi>evroom</bdi></a>’s instructions above and although I was able to rotate the screen with these instructions, like <a class="plugin-mentions-user plugin-mentions-a" href="/user/joern" aria-label="Profile: Joern">@<bdi>Joern</bdi></a>, the Magic Mirror modules only fill the bottom half of the screen.</p>
<p dir="auto">My CSS file is as follows (sorry, I don’t know how to put this in a separate box):</p>
<p dir="auto">body {<br />
margin: 0px;                               <em>If I omit “px”, Magic Mirror does not display correctly.</em><br />
position: absolute;<br />
transform: rotate(90deg);<br />
transform-origin: top right;<br />
width: 100vh;<br />
height: 100vh;                         <em>If I change this to “100vw”, Magic Mirror does not display correctly.</em><br />
object-fit: cover;<br />
top: 100vh;<br />
visibility: visible;<br />
background: #000;<br />
color: #aaa;<br />
font-family: “Roboto Condensed”, san-serif;<br />
font-weight: 400;<br />
font-size: 2em;<br />
line-height: 1.5em;<br />
-webkit-font-smoothing: antialiased;<br />
}<br />
.MMM-HTMLBox {<br />
font-size: 18px;<br />
line-height: 22px;<br />
}<br />
.MMM-RTSPStream header {<br />
text-align: left;<br />
}<br />
.MMM-RTSPStream .innerWrapper {<br />
border-style: none;<br />
}</p>
<p dir="auto">…a few more entries after these ones.</p>
<p dir="auto">My boot/config.txt contains the following entry:</p>
<p dir="auto">display_hdmi_rotate=0<br />
framebuffer_width=1600<br />
framebuffer_height=900</p>
<p dir="auto">Any entries shown here that were not included in <a class="plugin-mentions-user plugin-mentions-a" href="/user/evroom" aria-label="Profile: evroom">@<bdi>evroom</bdi></a>’s instructions, are from the original installation of Magic Mirror.</p>
<p dir="auto">I’m running Magic Mirror latest software on a Pi4 with an Acer 24" monitor.</p>
<p dir="auto">Any ideas as to what I should change in order for the modules to fill the entire screen?</p>
<p dir="auto">Any help will be greatly appreciated.</p>
]]></description><link>https://forum.magicmirror.builders/post/83592</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/83592</guid><dc:creator><![CDATA[hdez]]></dc:creator><pubDate>Sat, 17 Oct 2020 01:25:41 GMT</pubDate></item><item><title><![CDATA[Reply to Save performance when rotating screen e.g. on Raspberry Pi on Sat, 19 Sep 2020 09:42:45 GMT]]></title><description><![CDATA[<pre><code>transform: rotate(90deg);
transform-origin: top right;
</code></pre>
<p dir="auto">works at least see have screen, but only half screen is used, so no option…</p>
]]></description><link>https://forum.magicmirror.builders/post/82029</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/82029</guid><dc:creator><![CDATA[Joern]]></dc:creator><pubDate>Sat, 19 Sep 2020 09:42:45 GMT</pubDate></item><item><title><![CDATA[Reply to Save performance when rotating screen e.g. on Raspberry Pi on Sat, 19 Sep 2020 09:39:32 GMT]]></title><description><![CDATA[<p dir="auto">Hello,</p>
<p dir="auto">Iam struggeling on my PI3 to rotate by 90deg to right. Monitor has 1920x1080.<br />
But I see only black screen at any other position than -90deg!!<br />
As I need to change to 90deg or -270deg I got only black screen (also 180deg even) …</p>
<p dir="auto">So I changed config.txt to:</p>
<pre><code>display_hdmi_rotate=0
framebuffer_width=1920
framebuffer_height=1080
</code></pre>
<p dir="auto">&amp; custom.css to:</p>
<pre><code>body {
        margin: 0;
        position: absolute;
        transform: rotate(90deg);
        transform-origin: top left; 
        width: 100vh;
        height: 100vw;
        object-fit: cover;
        top: 100vh;
        visibility: visible;
}
</code></pre>
<p dir="auto">What is missing?</p>
<p dir="auto">Worse case I change physical mounting way, but not preferred :face_with_stuck-out_tongue_winking_eye:</p>
]]></description><link>https://forum.magicmirror.builders/post/82028</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/82028</guid><dc:creator><![CDATA[Joern]]></dc:creator><pubDate>Sat, 19 Sep 2020 09:39:32 GMT</pubDate></item><item><title><![CDATA[Reply to Save performance when rotating screen e.g. on Raspberry Pi on Sun, 17 Feb 2019 15:58:19 GMT]]></title><description><![CDATA[<p dir="auto">@j-e-f-f thank you! Of course you can :)</p>
]]></description><link>https://forum.magicmirror.builders/post/52549</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/52549</guid><dc:creator><![CDATA[ptrk95]]></dc:creator><pubDate>Sun, 17 Feb 2019 15:58:19 GMT</pubDate></item><item><title><![CDATA[Reply to Save performance when rotating screen e.g. on Raspberry Pi on Sat, 16 Feb 2019 10:53:53 GMT]]></title><description><![CDATA[<p dir="auto">Great hack!! I’m going to add this to my CSS 101 guide if that’s OK. I think this is incredibly useful.</p>
]]></description><link>https://forum.magicmirror.builders/post/52470</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/52470</guid><dc:creator><![CDATA[j.e.f.f]]></dc:creator><pubDate>Sat, 16 Feb 2019 10:53:53 GMT</pubDate></item><item><title><![CDATA[Reply to Save performance when rotating screen e.g. on Raspberry Pi on Thu, 14 Feb 2019 18:00:54 GMT]]></title><description><![CDATA[<p dir="auto">Didnt work that easy for me.</p>
<ol>
<li>You have to take the resolution of your display/monitor in the config.txt, not just 1600,900.</li>
<li>I had to enable overscan, cause the picture was to big.</li>
<li>If you’re using the MMM-Remote_Control the picture is rotated when you have a look at your MagicMirror.</li>
</ol>
<p dir="auto">I switched back to the fake KMS driver.</p>
]]></description><link>https://forum.magicmirror.builders/post/52361</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/52361</guid><dc:creator><![CDATA[thedk]]></dc:creator><pubDate>Thu, 14 Feb 2019 18:00:54 GMT</pubDate></item><item><title><![CDATA[Reply to Save performance when rotating screen e.g. on Raspberry Pi on Fri, 08 Feb 2019 15:28:13 GMT]]></title><description><![CDATA[<p dir="auto">Okay, found it.</p>
<p dir="auto">In my /boot/config.txt I had the width and height set to 900 and 1600 and this has to be now 1600 and 900.<br />
This is working:</p>
<pre><code>display_hdmi_rotate=0
framebuffer_width=1600
framebuffer_height=900
</code></pre>
<p dir="auto">Works now.</p>
<p dir="auto">Only need to modify the omxplayer lines to have those streams rotated too.</p>
]]></description><link>https://forum.magicmirror.builders/post/51859</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/51859</guid><dc:creator><![CDATA[evroom]]></dc:creator><pubDate>Fri, 08 Feb 2019 15:28:13 GMT</pubDate></item><item><title><![CDATA[Reply to Save performance when rotating screen e.g. on Raspberry Pi on Fri, 08 Feb 2019 15:19:47 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ptrk95" aria-label="Profile: ptrk95">@<bdi>ptrk95</bdi></a> said in <a href="/post/51853">Save performance when rotating screen e.g. on Raspberry Pi</a>:</p>
<blockquote>
<p dir="auto">Tell me if that worked for you.</p>
</blockquote>
<p dir="auto">Almost, but not quite.<br />
It does rotate clock wise, but it is centered.<br />
In Excel analogy: vertical alignment: center.<br />
I would need ‘top’.</p>
<p dir="auto">This is my custom.css, probably the other settings interfere:</p>
<pre><code>body {
  margin: 0;
  position: absolute;
  transform: rotate(-90deg);
  transform-origin: top left;
  width: 100vh;
  height: 100vw;

  object-fit: cover;
  top: 100vh;
        visibility: visible;
 }

.region.top.left {
  width: 60%;
}

.region.middle.center {
  width: 60%;
}

.region.bottom.left {
  width: 60%;
}

.MMM-HTMLBox {
  font-size: 18px;
  line-height: 22px;
}
.MMM-RTSPStream header {

  text-align: left;
}

.MMM-RTSPStream .innerWrapper {
  border-style: none;
  //border: 1px solid red;
}
</code></pre>
<p dir="auto">I want the left side modules to occupy 60% and the right side modules 40%.<br />
Maybe I have to interpret top, middle and bottom different now ?</p>
]]></description><link>https://forum.magicmirror.builders/post/51854</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/51854</guid><dc:creator><![CDATA[evroom]]></dc:creator><pubDate>Fri, 08 Feb 2019 15:19:47 GMT</pubDate></item><item><title><![CDATA[Reply to Save performance when rotating screen e.g. on Raspberry Pi on Fri, 08 Feb 2019 14:27:39 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/evroom" aria-label="Profile: evroom">@<bdi>evroom</bdi></a> Yes, I did rotate it counter clockwise.</p>
<p dir="auto">I found a solution that worked for my setup, rotating the screen 270:</p>
<pre><code> body {
	margin: 0;
	position: absolute;
 	transform: rotate(-90deg);
 	transform-origin: top left; 
	width: 100vh;
	height: 100vw;
	
	object-fit: cover;
	top: 100vh;
        visibility: visible;
 }
</code></pre>
<p dir="auto">Tell me if that worked for you. Then I`ll update the post :)</p>
<p dir="auto">Adjusting the omxplayer orientation is one of the drawbacks.</p>
]]></description><link>https://forum.magicmirror.builders/post/51853</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/51853</guid><dc:creator><![CDATA[ptrk95]]></dc:creator><pubDate>Fri, 08 Feb 2019 14:27:39 GMT</pubDate></item><item><title><![CDATA[Reply to Save performance when rotating screen e.g. on Raspberry Pi on Fri, 08 Feb 2019 11:50:59 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ptrk95" aria-label="Profile: ptrk95">@<bdi>ptrk95</bdi></a> said in <a href="/post/51599">Save performance when rotating screen e.g. on Raspberry Pi</a>:</p>
<blockquote>
<p dir="auto">and want to rotate the screen you can rotate</p>
</blockquote>
<p dir="auto">Did you counter clockwise rotated you screen ?<br />
And therefore did ``transform: rotate(90deg);```??</p>
<p dir="auto">I originally rotated my screen clock wise (so the top now is on the right hand side) using <code>/boot/config.txt</code> and <code>display_hdmi_rotate=3</code>.<br />
This works fine.</p>
<p dir="auto">When I use your css example and take out the /boot/config.txt line, it does not work right.<br />
I figured I need <code>rotate(270deg)</code>, but then I do not see anything.</p>
<p dir="auto">Besides that, the omxplayer modules need to be adjusted too (–orientation parameter), so I reverted back to my old method.</p>
<p dir="auto">My question: can you setup your screen so that it rotates this way that you see everything upside down (to simulate a clockwise rotation in your case) ??<br />
And then share the css code.</p>
]]></description><link>https://forum.magicmirror.builders/post/51825</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/51825</guid><dc:creator><![CDATA[evroom]]></dc:creator><pubDate>Fri, 08 Feb 2019 11:50:59 GMT</pubDate></item><item><title><![CDATA[Reply to Save performance when rotating screen e.g. on Raspberry Pi on Fri, 08 Feb 2019 10:21:35 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/keyun21" aria-label="Profile: keyun21">@<bdi>keyun21</bdi></a> Correct, just give it a go and see what happens ;) Just delete the lines if something strange occours.</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/justjim1220" aria-label="Profile: justjim1220">@<bdi>justjim1220</bdi></a> Thanks for sharing! :)</p>
<p dir="auto">Only disadvantage here is that you may have to change the styles of other modules, for example the Snow module doesn’t work right of the bat I think.</p>
<p dir="auto">Also note that there might be a better way to code it, since I just googled how to rotate with CSS :D</p>
]]></description><link>https://forum.magicmirror.builders/post/51817</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/51817</guid><dc:creator><![CDATA[ptrk95]]></dc:creator><pubDate>Fri, 08 Feb 2019 10:21:35 GMT</pubDate></item><item><title><![CDATA[Reply to Save performance when rotating screen e.g. on Raspberry Pi on Fri, 08 Feb 2019 04:31:11 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ptrk95" aria-label="Profile: ptrk95">@<bdi>ptrk95</bdi></a></p>
<p dir="auto">this code also works with a 42" TV!</p>
<p dir="auto">Thanks!!!<br />
:smiling_face:</p>
]]></description><link>https://forum.magicmirror.builders/post/51806</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/51806</guid><dc:creator><![CDATA[justjim1220]]></dc:creator><pubDate>Fri, 08 Feb 2019 04:31:11 GMT</pubDate></item><item><title><![CDATA[Reply to Save performance when rotating screen e.g. on Raspberry Pi on Fri, 08 Feb 2019 04:15:27 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ptrk95" aria-label="Profile: ptrk95">@<bdi>ptrk95</bdi></a> Thanks for sharing your code, so if i understood correctly (newbie here with CSS) I can just copy your code and plug it in my CUSTOM.CSS file and I should good to go (I understand i need to change “90deg” or so based on my monitor setup. TIA.</p>
]]></description><link>https://forum.magicmirror.builders/post/51804</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/51804</guid><dc:creator><![CDATA[keyun21]]></dc:creator><pubDate>Fri, 08 Feb 2019 04:15:27 GMT</pubDate></item></channel></rss>