There are a number of causes to need a native utility on Linux over a web site. It runs smoother, has options that individuals come to anticipate from a desktop app (like desktop-notifications), and general matches higher into the Linux expertise. The difficulty is although, not a number of mainstream functions come to the Linux platform. There’s a answer although; you may use an utility known as Nativefier to turn websites into Linux apps.

Get Nativefier

Nativefier is a NodeJS utility that runs on Linux, and different OSes that may run the Node software program. Because of this, this program isn’t arrange by default on any main Linux distribution. As an alternative, we’ll want to go over how to arrange Nativefier, earlier than it’s doable to begin changing websites into Linux apps.

Get Node and NPM

Like we talked about above: Nativefier depends closely on the NodeJS programming language, and also you’ll want to have it in your system to get the Nativefier app working. Fortunately, putting in NodeJS on the Linux platform is simpler than ever, as a result of many Node builders use Linux.

To put in NodeJS in your working system, open up a terminal window and observe the step-by-step directions that match your Linux working system under.

Ubuntu

sudo apt set up npm

Debian

su -
apt-get set up curl
curl -sL  | bash -
apt-get set up -y nodejs

Arch Linux

sudo pacman -S npm

Fedora

sudo dnf set up npm

OpenSUSE

sudo zypper set up npm

Generic Linux

NodeJS is available on most fashionable Linux working techniques, through the “nodejs” or “npm” packages. Nevertheless, if these packages aren’t obtainable to you (for some motive), there may be one other method to get NodeJS working: the supply code.

To get NodeJS in your Linux distribution, go to the official web site’s obtain web page. As soon as there, search for the Linux supply downloads and seize it. Then, extract the Tar archive and observe the directions included within the readme textual content file. You might also need to refer to the official NodeJS instructions for Linux.

Set up Nativefier

NodeJS is up and working on Linux. Now, we should use the NodeJS instruments to get Nativefier working, in order that we will use it on Linux to create functions of our favourite websites. To put in, open up a terminal and use the npm command.

Warning: putting in Nativefier with out sudo could trigger points. It’s greatest to do it with root privileges.

npm set up nativefier -g

Let the NPM set up instrument run the set up course of. When finished, you may entry the assistance web page with this command:

nativefier --help

Turn websites into Linux apps

Nativefier works by producing an Electron wrapper primarily based on the URL it will get within the command-line. To create a local Linux utility out of a web site, observe these steps.

Step 1: Discover the web site you’d like to create an app out of. Strive to persist with a “web app,” or web-based instrument for the browser that may as properly be a program anyway. Nativefier works greatest this fashion. When you’ve obtained your web site in-mind, spotlight the URL with the mouse, right-click on it and choose the “copy” possibility.

Step 2: Within the terminal window, use Nativefier to generate a primary app. In our tutorial, we’ll use YouTube.

nativefier -p linux -a x64 

Step 3: Let Nativefier package deal your URL into an electron utility, and pay shut consideration to the terminal immediate. If any errors seem, press Ctrl + Z, then re-run the command once more.

Step 4: When Nativefier finishes producing an utility, you’ll want to replace the permissions of the appliance earlier than having the ability to use it. To set the permissions, do:

cd *-linux-x64

sudo chmod +x *

Run your customized Electron app proper on Linux with:

./you-tube

Customized app choices

On this part of the tutorial, we’ll briefly go over some choices that Nativefier has that enable the consumer to make a greater desktop utility.

Word: these instructions may be entered on the similar time, and there’s no restrict to what number of used without delay.

System-tray

Need a system-tray in your customized Electron utility? Do this command:

nativefier -p linux -a x64  --tray

Full-screen

Wishing your Linux app may go full-screen? Use the full-screen command swap.

nativefier -p linux -a x64  --full-screen

Begin Maximized

It’s doable to drive your Linux electron utility to all the time begin up in “maximize” mode, with the “Maximize” command-line swap.

nativefier -p linux -a x64  --maximize

Allow FlashPlayer

You could have an online utility that depends on Flash. Fortunately, Nativefier has a method to load up the Adobe Flash plugin, when you construct your program with the “flash” command-line swap.

nativefier -p linux -a x64  --flash

All the time on high

Need your Electron app to ignore window supervisor guidelines and all the time seem on high of every thing else? Strive the “always on top” command-line swap when constructing with Nativefier.

nativefier -p linux -a x64  --always-on-top



Source link

Share.
Leave A Reply

Exit mobile version