-
-
Notifications
You must be signed in to change notification settings - Fork 579
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Linux support #13
Conversation
} | ||
} | ||
); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the menues are so different on OS X and Linux I think it would be better to just create a separate file with a Linux menu instead of juggling this mess. The Help
menu is common and can be a menu-common.js
file and required into each.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's reasonable. It started out not too bad, and then as I added more and more to it, it got crazier and crazier 😛
Make sure the Linux menu is consistent with other Linux apps. |
type: 'separator' | ||
}, | ||
{ | ||
label: 'Preferences...', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On Linux it's only Preferences
, not Preferences...
.
Unfortunately, From what I managed to get by messing around with |
what would you prefer the behavior of |
|
When trying to build them together, I run into the following problems:
I think two separate build commands might be necessary for that top reason. For the bottom two, I'm sure it's just me being silly and missing something in their documentation. (I still have no idea what |
Ugh, I'm ok with just being able to build from OS X. I'm the only one that creates builds anyways. Having one build massively simplifies it, so I think it's worth the limitation.
Can you elaborate? It's the
The media folder is ignored. I guess we can ignore everything in the media folder, except the icon. |
from for now, I've just set the What I could do is have I tried removing |
ok, I have a solution that more or less works, as far as I can tell. It should allow you to create a Linux zip and an OS X zip by running |
${app.getName()} ${app.getVersion()} | ||
${process.platform} ${process.arch} ${os.release()}`; | ||
${app.getName()} ${app.getVersion()} | ||
${process.platform} ${process.arch} ${os.release()}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't indent this. Template literals are whitespace sensitive.
} | ||
}, | ||
{ | ||
label: `About ${appName}`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On Ubuntu it's just About
.
Look at the existing Linux menues to make sure everything is consistent.
Is there any way to have the app installable on Linux with something like If https://github.com/loopline-systems/electron-builder supported Linux we could use that. Maybe worth opening a feature request for that? |
We could look at how atom builds their deb's/rpm's and mimic that. Would at least support the major distributions |
I've addressed your feedback about the menus and fixed the accidental inclusion of linux in the build-osx command. For menu consistency, I'm not sure there's a really good standard compared to what there is on OS X. I tried to go off of Gedit. Most Gnome apps use the menu at the top of the screen (that I've not seen any other app use, and don't think there's support for in electron), but gedit has a more traditional File / Edit / Help etc. You mentioned that the edit menu shouldn't have some of those items, but gedit has all of them. I've left them there for now; which ones were you thinking of? About packaging -- I don't think there's a good way to distribute this unless we make it build an RPM and a DEB. I'll make a feature request on https://github.com/loopline-systems/electron-builder, and revisit this later if they add support. |
Also, I'd be more than happy to squash these commits if you want so that |
issue for adding linux support to the builder: electron-userland/electron-builder#7 |
I think it just depends on the application, things like gedit, kate, mousepad, etc make use of those edit menu items where as others don't. They probably are useful for any type of text editing but I'm not sure this app needs menu items for it. Take for example Telegram on the desktop for Linux, it doesn't contain any of those menu items (File, Edit) etc. |
@tschuy Landed! Really appreciate you working on this :) |
Like you noted in #11, this essentially boils down to putting the
app.dock
into an if statement. (I don't think there's any Linux equivalent to the dock icon with a number on it, or the bouncing dock icon.)I also rearranged the menu to be more cross-platformy, since there's no appname menu on most distributions of Linux. (Though there is in Gnome 3, the desktop manager I use, but I couldn't figure out how to add to it from Electron, and Atom doesn't use it either.)
There is a bug with desktop notifications crashing (electron/electron#2294) that seems pretty awful. The issue isn't entirely clear which versions of what it presents itself on, so I added a note to the README about it. The notifications themselves work just fine, and as long as you don't click on them, the system won't crash.
I would be happy to make any changes you need before merging this. I could also test it on a non-Gnome environment.