How to remove Skype icon from the menu bar?

All minimalist and perfectionist you are welcome. Today we will make our life a bit easier by removing Skype icon from 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. All of them 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.

How 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 StackExchange. I have used the following command for a long time, but after maybe March 2022 updates it stopped working.

LC_ALL=C sed -i '' -e "s/_initTray(){.\{7\}/_initTray(){return;/" -e "s/initTrayMenu(){.\{7\}/initTrayMenu(){return;/" /Applications/Skype.app/Contents/Resources/app.asar

Let me explain what the command do. It’s open Skype files and replaces some code. Fortunately, the Skype was written by using some HTML/JS/CSS framework, I guess it’s Electron. So, you can easily open app files and edit JS code to change behavior or app.

Let’s edit the files manually to the disabled annoying Skype icon.

HEX editor

At first, you need to have some HEX editor. I am using Hex Fiend, you can download it from the official web page.

Skype updates

When you get an editor, I guess you to update Skype to the latest version. Each update will remove our code changes. So after update, you have to edit Skype files again 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.

Also, I recommend keeping the downloaded installer or you can just backup the original files. This could help to restore Skype if you broke something.

Close Skype

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.

Edit files

Run an editor and open file /Applications/Skype.app/Contents/Resources/app.asar. You will see something like the following image.

Now open Find & Replace menu and find the code:

_initTray(){this._tray=new

Replace it with following one:

_initTray(){return;ray=new

After don’t forget to save the file. Voila! We successfully remove the Skype icon from the menu bar.

Explanation

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.

The best way to disable executing code is just to put a return statement in the first line of the function. However, if you just add return in the first line it broke Skype. I guess that happens, coz the file length changed in case of adding new code. The solution is just replacing the current code with a new one with the same length.

I hope this article was useful for you. Ask any questions in the comments section below if something is not clear for you.

Leave a Reply

Your email address will not be published.