-
Notifications
You must be signed in to change notification settings - Fork 299
Linux support #13
Comments
Yes, unfortunately I do not have a Linux box to test support at the moment, but in theory it should be straightforward to support. Electron itself is fortunately compatible with Linux, so there shouldn't be much work to make it compatible. It might be sufficient to reverse those checks to check for Windows instead. I'll flip those checks for now, since there is no harm in that, and potentially it could at least get the Linux build running to test further. |
Cool, but you forgot the check in cli/oni. After #15 I can successfully build and run on Linux. No issues running, though the default font seems unavailable. Not sure how to go about this correctly since available fonts vary wildly between distributions. On another note, how do I configure the Neovim part? It doesn't seem to use my existing Neovim configuration. |
Sweet, thanks for the fix! That's great that it is launching now. Regarding the font - there's this code in Config.ts:
That picks some defaults for Mac & Windows. We might need to come up with a set of defaults for Linux - but I'm not sure what a good default font on Linux is. An alternative would be to bundle a default font with the app (like fontawesome is bundled right now). I opened another issue for sourcing the init.vim - #16 |
Bundling a default font would probably the most robust method. Alternatively, is a list of fonts possible? ONI could try a couple of common fonts which should cover pretty much every user. |
Makes sense. I don't think there is a great way to list the fonts, and then identify which ones are monospace. We could potentially bundle this font: It has an open license and is monospace. I'll take a look at bundling it in the next couple days. In the meantime, you might want to manually change the font family to your preferred font. |
I was trying to install this on Linux and I got this error at the "npm install..." level:
I'm not familiar at all with node or npm. Is is trying to look for a fil in /usr/local/lib that doesn't exist? |
@define-private-public - hmm, seems like npm failed to install electron - maybe related to one of these issues? |
Okay, I got a little farther by install Node from a different repo, now I'm getting this error: I find those permission errors odd as I'm running the
|
FWIW, I just installed on Arch Linux with no problems. Using the latest version of node and npm and running the Build directions on the project page.
It looks like you're using:
Is there a reason why you're using older versions? |
@keforbes It must have been from the repo that I pulled it from (I guess they weren't keeping things up to day). I'll try it again and see what happens. |
Please excuse my ignorance (I don't know anything about Electron development) but isn't that fontFamily property used like a CSS property? Can't you define multiple fonts as fallbacks? For example, in CSS you could do:
This would be the order of preferred fonts, where the default I just tried changing MacConfig to:
and it seemed to have an effect on Linux (since it's checking for Edit: My list of fonts was pretty much arbitrary. I found a more comprehensive list of monospace fonts (both Windows and Mac) which is probably better if you take this route:
|
@keforbes - not ignorant at all, thanks for the suggestion :) We use the font family to set the font in the canvas. For some reason I thought that you couldn't have font fallbacks in the canvas font, but I could very well be mistaken. If you're up for it, feel free to send out a pull request with the fallback fonts! Would be helpful to have. DejaVu Sans Mon was just added for Linux by @JakubJecminek , but having additional fallbacks for all the platforms wouldn't hurt. |
Yeah, you can set ctx.font to a comma-separated list of fonts of which the first available will be used, just like in CSS. (demo) |
@darkwater thanks for the jsfiddle, you're right, good call. It seems like it would be helpful to have a set of fallback fonts that we append when drawing our text (in ctx.font) regardless of what that value is, so we can at least be guaranteed a monospace font even if the font doesn't exist. I believe this is similiar to how gvim behaves. Potentially we could add the fallback here, I'm thinking, when we set the font |
Closed this out since most of the conversation was specific to fonts... I'm sure there are lots of other Linux-specific issues, though. Feel free to log additional issues as they come up (I don't use Linux for development at the moment, so these are the last issues for me to find) |
Looks like ONI only supports Windows and macOS right now? Judging by some of the source files it checks whether the OS is "Darwin", and assumes Windows otherwise.
What needs to be done for this to run on Linux?
The text was updated successfully, but these errors were encountered: