Manually write Messenger Desktop for Linux with Nativefier

Tram Ho

Reason

I don’t use Facebook that much, but only Messenger to chat for work and friends – Although I like Telegram better, he is 3000 times better than his Messenger. The Messenger guy now seems to have an Official version on Windows, and the Linux side is like a stepchild. Every time you use it, you have to find it in your pile of tabs. So I understand to try it by myself. After a while of learning, there is a package that helps me with this, of course it is not a native app, but a wrapper of Electron.

Nativefier

Nativefier is an Electron wrapper used to create D esktop Applications for Linux and other platforms. However, I only use this on Linux so I can’t test it on other platforms. Alternatively, you can dabble in a little more for this application, for example inject javascript or css .

https://raw.githubusercontent.com/jiahaog/nativefier/HEAD/docs/walkthrough.gif

Installation and usage

Install this package, then set the global flag and use it for later. If not, it’s fine to remove the global flag.

Use is extremely simple. Use nativefier to convert web app messenger.com for linux platform.

After running this command, nativefier will generate a folder called Messenger-linux-x64

At this point start up with the command

That’s it, there is a Desktop Application already.

Extend

Of course, if that is not the case, it will not take full advantage of Nativefier’s features. Here, I will expand a bit more, I will make Dark Mode for my scabies app. Electron is a framework used to build desktop applications using html, css, javascript. Then this nativefier is built based on electrons. Thus, if you want to change the interface of the application, just add the dark mode css to it. To inject css in the natifier, use the flag —inject. So I fix the code a bit.

Then go to Messenger-linux-x64/resources/app/inject **** to edit the dark.css file as follows. Someone’s wife on github

So there is a Messenger Dark Mode Desktop Application.

You can check out more cool Nativefier APIs here. There are many cool things that can be used.

At this point, it seems not enough, I still have to create a shortcut for it to click and run. Now, you must use some Linux SHELL commands.

The first is to create a shortcut for it called shortcut.sh

Next is to create the install.sh file

Then finish the remove.sh file to give it full set

Conclude

The above is simply a package that helps me convert a Web App to the Desktop App. However, if Custom was good, then it wouldn’t be that great. In addition, I can use this guy to do some App for me, for example Zalo, or Whatsapp. It is also an application, because having an app is better than using a browser.

You can watch the repo at my GIthub.

Share the news now

Source : Viblo