How to remove Skype icon from the menu bar?
Tags: macos, skype, menubar
Published: 2022-11-01 19:55:23

<!-- wp:paragraph -->
<p>All minimalists and perfectionists are welcome. Today we will make our life a bit easier by removing the Skype icon from the Mac OS menu bar. I am using a lot of messenger apps on my MacBook: Telegram, Signal, Slack, Upwork messages, sometimes Whatsapp, sometimes Viber, and Skype. They don't have an icon in the menu bar, but Skype does. And there isn't any option or setting to remove it. So today, we will smash that icon from our life! Welcome undercut. </p>
<!-- /wp:paragraph -->

<!-- wp:more -->
<!--more-->
<!-- /wp:more -->

<!-- wp:paragraph -->
<p>How is it possible to remove the Skype icon from the menu bar? The answer is editing Skype source files. I should say this is not my invention. I have found this way on <a href="https://apple.stackexchange.com/questions/380075/how-to-remove-skype-menu-bar-icon-from-macos" target="_blank" rel="noreferrer noopener">StackExchange</a>. I have used the following command for a long time, but after maybe March 2022 updates, it <strong>stopped</strong> working. </p>
<!-- /wp:paragraph -->

<!-- wp:enlighter/codeblock -->
<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">LC_ALL=C sed -i '' -e "s/_initTray(){.\{7\}/_initTray(){return;/" -e "s/initTrayMenu(){.\{7\}/initTrayMenu(){return;/" /Applications/Skype.app/Contents/Resources/app.asar</pre>
<!-- /wp:enlighter/codeblock -->

<!-- wp:paragraph -->
<p>Let me explain what the command does. It opens Skype files and replaces some code. Fortunately, Skype was written using some HTML/JS/CSS framework, and I guess it's Electron. So, you can easily open app files and edit JS code to change the app's behavior. </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Let's edit the files manually to the disabled annoying Skype icon. </p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2>HEX editor</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>First, you need to have some HEX editor. I am using Hex Fiend, and you can download it from <a href="https://hexfiend.com" target="_blank" rel="noreferrer noopener">the official web page</a>.</p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2>Skype updates</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>You got an editor, then the next step you should update Skype to the latest version. Each update will remove our code changes. So after the update, you have to edit Skype files to remove the icon. Maybe later, I'll make some automation for that, but for now, it's okay for me to edit source code sometimes. </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Also, I recommend keeping the downloaded installer, or you can back up the original files. It could help to restore Skype if you broke something. </p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2>Close Skype</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Some guys on StackExchange suggest running Skype at least once before editing source code files. Also, this is a good idea to check does Skype works before you start. Anyway, close Skype before editing it.</p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2>Edit files to remove the Skype icon</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Run an editor and open file <em>/Applications/Skype.app/Contents/Resources/app.asar</em>. You will see something like the following image.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><strong>UPDATE 09.04.2023</strong></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Skype added multiple files for Intel or Apple Silicon processors systems. Approximately from version 8.95.0.408 you should edit file <em>/Applications/Skype.app/Contents/Resources/app-x64.asar</em> or <em>/Applications/Skype.app/Contents/Resources/app-arm64.asar</em> depending on your CPU type. </p>
<!-- /wp:paragraph -->

<!-- wp:image {"id":2575,"sizeSlug":"large","linkDestination":"none"} -->
<figure class="wp-block-image size-large"><img src="https://jakeroid.com/wp-content/uploads/2022/05/image-1024x304.png" alt="" class="wp-image-2575"/></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>Now open Find &amp; Replace menu and find the code:</p>
<!-- /wp:paragraph -->

<!-- wp:enlighter/codeblock -->
<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">_initTray(){this._tray=new</pre>
<!-- /wp:enlighter/codeblock -->

<!-- wp:paragraph -->
<p>Replace it with the following one:</p>
<!-- /wp:paragraph -->

<!-- wp:enlighter/codeblock -->
<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">_initTray(){return;ray=new</pre>
<!-- /wp:enlighter/codeblock -->

<!-- wp:paragraph -->
<p>After don't forget to save the file. Voila! We successfully remove the Skype icon from the menu bar.</p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2>Explanation</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>This code is the beginning of the _initTray functions, which is responsible for creating an icon in the menu bar, handling clicks on it, etc. To disable the icon, we need to change the body of the _initTray function. </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>The best way to disable executing code is to put a return statement in the first line of the function. However, if you add return in the first line, it breaks Skype. I guess that happens because the file length changed in case of adding new code. The solution is to replace the current code with a new one with the same length. </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>I hope this article was helpful to you. Ask questions in the comments section below if something is unclear for you. </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>By the way, I posted <a href="https://jakeroid.com/blog/port-5000-is-already-in-use-in-macos-monterey/">why port 5000 is already in use on Mac OS</a> some time ago. Maybe you are interested.</p>
<!-- /wp:paragraph -->