pojala / electrino

Desktop runtime for apps built on web technologies, using the system's own web browser engine
MIT License
4.38k stars 101 forks source link

Linux port #1

Open edipox opened 7 years ago

edipox commented 7 years ago

What are your plans on porting it to Linux?

I think that electron apps are especially useful for Linux desktop given that we usually don't have that much third party attention compared to Windows and macOS. A good example is Wunderlist, there are Wunderlist apps for almost every platform (Windows, iOS, macOS, android, etc.. even the now dead Ubuntu Phone I think) except for Linux.. and that's why I created this project: WunderlisTux which I'd love to implement using Electrino instead of Electron.

dyu commented 7 years ago

Have you tried?

/usr/bin/google-chrome --app=$url
edipox commented 7 years ago

Thank you for your suggestion @dyu but I couldn't fully understand it. Could you expand more?

marcoms commented 7 years ago

@edipox @dyu's solution uses Chrome which I don't think is the point of Electrino. Ideally this project should use the WebKitGtk or QtWebKit frameworks, which are commonly installed by many distros.

bates64 commented 7 years ago

I'd say use WebkitGtk or QtWebkit where possible, and use Chromium if they don't exist on the target distro - i.e. compile separately for different Linux distros.

Assuming gtk/qt aren't supported everywhere.

tbodt commented 7 years ago

I'd rather not have different download links for different distros...

betoharres commented 7 years ago

at least target to ubuntu distro, electron idea was to be cross-(common)plataform. I think targeting ubuntu first would be sufficient

norman784 commented 7 years ago

I'm not 100% sure but linux distros doesn't come with a preinstalled web engine? If not electrino will need to install a compatible web engine for that distro and start running (similar to adobe air, but the main difference its that the web engine is backward compatible so you would need only the latest version)

betoharres commented 7 years ago

I don't know either, I mainly use macOS but I really want it to be cross-platform(on the common OSs)

pojala commented 7 years ago

Thanks for the discussion, and sorry for being slow to reply!

I was thinking of using WebKitGtk at least initially, as it's part of GTK+ which is available on the most relevant end-user distros. It seems to me that would be the closest equivalent of WebKit on Mac.

ghost commented 6 years ago

How can I use this for n Linux? Nobody said this so far.

tbodt commented 6 years ago

@Jimster121 You can't, at the moment

ghost commented 6 years ago

What about this:

/usr/bin/google-chrome --app=$url

?

tbodt commented 6 years ago

@Jimster121 1. requires google chrome to be installed 2. you could fix this by including chrome with your app but then why not use electron and save some work

ghost commented 6 years ago

Google Chrome is very resource heavy and this is why I am trying to find something else. Let's say that I will not use Google Chrome and use something else, how can I do it? what are the commands I have to type? Is WebKit ideal or better?

ghost commented 6 years ago

What about WebKit? Will it make any difference?

tbodt commented 6 years ago

WebKit is not included with Linux.

ghost commented 6 years ago

If it's not included with Ubuntu, then what about including it with the app?

tbodt commented 6 years ago

You could, but then why not use Electron and save yourself some time.

ghost commented 6 years ago

If WebKit or any other web engine can save memory usage, then I'll spend as much time as needed in order to achieve this. :pensive: Electon makes way too big apps.

tbodt commented 6 years ago

The space savings from Electrino doesn't come from using WebKit instead of Chromium, it comes from not including any browser engine.

ewnd9 commented 6 years ago

Just for the reference what similar projects use on Linux

Update: added kapouer/node-webkitgtk

Update 2: added zserge/webview, group by language

Update 3: added node-gir, gjs, and cgjs

ghost commented 6 years ago

What I want is to use the default web engine of Ubuntu. If there is no default web engine that comes pre-installed then I'll need to add the engine to the project or tell the user to install it through apt. My questions are: Will the Ubuntu's default engine save RAM/CPU? Will any other web engine that can be installed by the user save RAM/CPU? How big will be the app?

marcoms commented 6 years ago

Looks like the best solution for Linux will be marking webkitgtk as a dependency through each package manager (apt, dnf, pacman, etc). This way at least there is a chance it would have been installed by another package previously, so it doesn't need to be downloaded again by Electrino.

ghost commented 6 years ago

I was thinking of making a script that will install everything needed (including all the dependencies). So provided that I'll use WebKit which will get installed through that script, how am I going to make the app? A command was previously mentioned, but I didn't understand anything.

marcoms commented 6 years ago

@Jimster121 this thread is not the most appropriate for individual questions, but if you install webkitgtk then you will need to include it as a library, using GTK as your toolkit.

If you just want to write web code, then you can use for example chrome and run it with the command you mentioned earlier:

/usr/bin/google-chrome --app=/path/to/your/webapp

Using your own script to install everything will not be viewed as secure by a lot of people. I'd recommend just using a package manager as mentioned.

ghost commented 6 years ago

I'm not an 'advanced' user, so I don't know how can I include webkitgtk as a library etc. The main problem is that I don't know where and how can I use the /usr/bin/google-chrome --app=/path/to/your/webapp command. Should I cd to a special folder? Should I download a package or something? Can you give some details on this? When I ran the /usr/bin/chromium-browser --app=/home/jimmy/Desktop/helloworld command (I have chromium so I replaced that part), it just opens Chromium.

ewnd9 commented 6 years ago

@Jimster121 if you google --app the first result should be https://developer.chrome.com/apps/first_app which contains a link to an examples repo https://github.com/GoogleChrome/chrome-app-samples/tree/master/samples/hello-world

To run this you need to do the following:

$ git clone https://github.com/GoogleChrome/chrome-app-samples.git
$ google-chrome --load-and-launch-app=$PWD/chrome-app-samples/samples/hello-world

(Apparently, --app expects appId and the appropriate flag for launching from cmd is --load-and-launch-app)


Also, there is a warning on top of Chrome Apps docs about deprecation in favor of webapps and Electron (and NW.js) https://blog.chromium.org/2016/08/from-chrome-apps-to-web.html

ghost commented 6 years ago

With your command Chromium was launched along with a 'Hello, World!' app which is good. Since it is launched on Chrome/Chromium it uses a huge amount of RAM. How can I use WebKit instead of Chromium? Will it make any difference on performance?

ewnd9 commented 6 years ago

@Jimster121 just explore any of the projects from my listing above https://github.com/pojala/electrino/issues/1#issuecomment-361817249

sxiii commented 4 years ago

Hmm. Any luck with the linux webkit version?