<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Lilika Makabe</title>
    <description>The latest articles on DEV Community by Lilika Makabe (@spookie).</description>
    <link>https://dev.to/spookie</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F862644%2F631a5920-635b-473b-96cd-99b9e6f7522e.PNG</url>
      <title>DEV Community: Lilika Makabe</title>
      <link>https://dev.to/spookie</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/spookie"/>
    <language>en</language>
    <item>
      <title>Mac's Screen Sharing with Multiple Monitors 🖥🖥 ▶️🖥🖥</title>
      <dc:creator>Lilika Makabe</dc:creator>
      <pubDate>Fri, 23 Sep 2022 05:29:15 +0000</pubDate>
      <link>https://dev.to/spookie/macs-screen-sharing-from-multiple-monitors-to-multiple-monitors--2bl2</link>
      <guid>https://dev.to/spookie/macs-screen-sharing-from-multiple-monitors-to-multiple-monitors--2bl2</guid>
      <description>&lt;h2&gt;
  
  
  Intro
&lt;/h2&gt;

&lt;p&gt;Although MacOS offers an official remote desktop App, "Screen Sharing," it doesn't support a 'multiple monitors to multiple monitors' remote access. &lt;br&gt;
Opening 2 sessions, one corresponding to 1st monitor, the other to 2nd would be an alternative, but actually Screen Sharing App doesn't support opening multiple sessions from within the app for the same PC, same user. &lt;/p&gt;

&lt;p&gt;So people has struggled to prepare multiple users &lt;br&gt;
&lt;a href="https://discussions.apple.com/thread/251160403"&gt;[App Community : "How to screen share with multiple monitors on both computers"]&lt;/a&gt;, but it's hastle, at least for me.&lt;/p&gt;

&lt;p&gt;I finally managed to do it, without the bothering work like switching the user, and summarize how to do that in the following! Glad if someone finds it helpful:)&lt;/p&gt;
&lt;h2&gt;
  
  
  Answer
&lt;/h2&gt;

&lt;p&gt;The answer was a quite simple, if you call the executable of the App, then you can open 2 sessions, for the same destination.&lt;/p&gt;
&lt;h3&gt;
  
  
  Search App's executable
&lt;/h3&gt;

&lt;p&gt;In MacOS (I'm using Monterey), any App's executable is often located at &lt;code&gt;${APP_DIRECTORY}/Contents/MacOS/${APPNAME}.&lt;/code&gt;&lt;br&gt;
In my system, Screen Sharing is in &lt;code&gt;/System/Library/CoreServices/Applications/Screen\ Sharing.app&lt;/code&gt;, so calling the following command in Terminal results in 2 sessions of remote desktop.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# open for 1st monitor&lt;/span&gt;
/System/Library/CoreServices/Applications/Screen&lt;span class="se"&gt;\ &lt;/span&gt;Sharing.app/Contents/MacOS/Screen&lt;span class="se"&gt;\ &lt;/span&gt;Sharing
&lt;span class="c"&gt;# call the same exe. for 2nd monitor&lt;/span&gt;
/System/Library/CoreServices/Applications/Screen&lt;span class="se"&gt;\ &lt;/span&gt;Sharing.app/Contents/MacOS/Screen&lt;span class="se"&gt;\ &lt;/span&gt;Sharing
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  For easy calling
&lt;/h3&gt;

&lt;p&gt;Although just calling the above command solves the problem, it is still troublesome to memorize the path or hit this long path, so I prefer to set the alias for the command.&lt;br&gt;
All you need to do is to open the &lt;code&gt;~/.bashrc&lt;/code&gt;, add the following line somewhere in that file, and save it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# User specific aliases and functions&lt;/span&gt;
&lt;span class="nb"&gt;alias &lt;/span&gt;&lt;span class="nv"&gt;remote_desktop&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"/System/Library/CoreServices/Applications/Screen&lt;/span&gt;&lt;span class="se"&gt;\ &lt;/span&gt;&lt;span class="s2"&gt;Sharing.app/Contents/MacOS/Screen&lt;/span&gt;&lt;span class="se"&gt;\ &lt;/span&gt;&lt;span class="s2"&gt;Sharing"&lt;/span&gt;
&lt;span class="c"&gt;## ... other settings...&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;then run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;source&lt;/span&gt; ~/.bashrc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;to reflect the change in &lt;code&gt;~/.bashrc&lt;/code&gt;.&lt;br&gt;
Since &lt;code&gt;~/.bashrc&lt;/code&gt; is read and reflected when bash starts, the above is needed to force bash to read the configuration &lt;br&gt;
 in &lt;code&gt;~/.bashrc&lt;/code&gt; again.&lt;/p&gt;

&lt;p&gt;Then after that, everytime you hit&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;remote_desktop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;in Terminal, the new Screen Sharing window will open up.&lt;br&gt;
I'm connecting from 2 monitors (local) to 2 monitors (remote) without any problem.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;Calling the executable itself enables us to open the multiple sessions almost for any App, for example like Blender.&lt;br&gt;
 If suddenly the above solution stopped operating after a major update, then I suspect the directory structure has changed. &lt;br&gt;
You may want check if the path really exists, and search the new executable path.&lt;br&gt;
 Anyway, hope multiple monitors to multiple monitor remote desktop will be officially supported in the future.&lt;/p&gt;

</description>
      <category>mac</category>
    </item>
  </channel>
</rss>
