<?xml version="1.0" encoding="utf-8"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Posts about display</title><link>https://chriswarrick.com/</link><atom:link href="https://chriswarrick.com/blog/tags/display.xml" rel="self" type="application/rss+xml" /><description>A rarely updated blog, mostly about programming.</description><lastBuildDate>Sat, 24 Jun 2017 19:02:47 GMT</lastBuildDate><generator>https://github.com/Kwpolska/YetAnotherBlogGenerator</generator><item><title>Apple broke the display menu, so I wrote my own</title><dc:creator>Chris Warrick</dc:creator><link>https://chriswarrick.com/blog/2017/06/24/apple-broke-the-display-menu-so-i-wrote-my-own/</link><pubDate>Sat, 24 Jun 2017 19:02:47 GMT</pubDate><guid>https://chriswarrick.com/blog/2017/06/24/apple-broke-the-display-menu-so-i-wrote-my-own/</guid><description>
A short time ago, the macOS display menu stopped working for me. It no longer had options to change mirroring settings, only supporting AirPlay. So I wrote my own, also solving some other issues.
</description><content:encoded><![CDATA[
<p>A short time ago, the macOS display menu stopped working for me. It no longer had options to change mirroring settings, only supporting AirPlay. So I wrote my own, also solving some other issues.</p>



<p>The first thing to consider is: what features do I really want? I’m using a MacBook Pro with an external display. I sometimes need to switch to only one display <a class="brackets" href="https://chriswarrick.com/blog/2017/06/24/apple-broke-the-display-menu-so-i-wrote-my-own/#footnote-1" id="footnote-reference-1" role="doc-noteref"><span class="fn-bracket">[</span>1<span class="fn-bracket">]</span></a> — mirroring is useful here. Although I can afford to put the dock at the bottom in dual-screen mode, it works better on the right if I’m tight on space. <a class="brackets" href="https://chriswarrick.com/blog/2017/06/24/apple-broke-the-display-menu-so-i-wrote-my-own/#footnote-2" id="footnote-reference-2" role="doc-noteref"><span class="fn-bracket">[</span>2<span class="fn-bracket">]</span></a> Also when working on the MacBook screen, I can switch to a higher resolution. So, I need:</p>
<ul class="simple">
<li><p>mirroring</p></li>
<li><p>screen resolution</p></li>
<li><p>dock position and icon size</p></li>
</ul>
<p>But I don’t want to pick all those three independently — a preset, like <em>dual screen</em> or <em>MacBook only, 1440×900</em> works better.</p>
<p>So, I wrote <strong>Display Menu</strong>. It’s a simple menu bar extra — I haven’t yet built any friendly configuration GUI for it, so all you get for now is a JSON file. It’s roughly 600 lines of Swift. The app doesn’t do much, other than displaying an icon in the menu bar, and setting display preferences when asked to. But hey, it works for me.</p>
<p>Also, I must admit that Swift is a pretty nifty thing. Although the function to read JSON files needs to do a ton of type casting, and some of the low-level stuff looks as ugly as in C, but other than that, Swift is a modern, friendly language.</p>
<p>Display Menu is open-source, licensed under the 3-clause BSD license. <a class="reference external" href="https://github.com/Kwpolska/DisplayMenu">Fork it on GitHub</a> or <a class="reference external" href="https://github.com/Kwpolska/DisplayMenu/releases">download binary releases</a>.</p>
<aside class="footnote-list brackets">
<aside class="footnote brackets" id="footnote-1" role="doc-footnote">
<span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="https://chriswarrick.com/blog/2017/06/24/apple-broke-the-display-menu-so-i-wrote-my-own/#footnote-reference-1">1</a><span class="fn-bracket">]</span></span>
<p>Inkscape/Xorg don’t work well with multiple displays. I can also mirror and turn off the external screen or use it with some other device.</p>
</aside>
<aside class="footnote brackets" id="footnote-2" role="doc-footnote">
<span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="https://chriswarrick.com/blog/2017/06/24/apple-broke-the-display-menu-so-i-wrote-my-own/#footnote-reference-2">2</a><span class="fn-bracket">]</span></span>
<p>also, in dual-screen mode, I can have the dock on one screen only, and the dock must live on the edge of the “extended” display — so either on the left side of the MacBook screen, or on the right side of the external display.</p>
</aside>
</aside>
]]></content:encoded><category>Programming</category><category>app</category><category>Apple</category><category>display</category><category>programming</category><category>projects</category><category>Swift</category></item></channel></rss>