Comments (15)
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.
from oni.
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.
from oni.
Sweet, thanks for the fix! That's great that it is launching now.
Regarding the font - there's this code in Config.ts:
const MacConfig: any = {
"editor.fontFamily": "Monaco"
}
const WindowsConfig: any = {
"editor.fontFamily": "Consolas"
}
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
from oni.
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.
from oni.
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:
https://fonts.google.com/specimen/Inconsolata
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.
from oni.
I was trying to install this on Linux and I got this error at the "npm install..." level:
sh: 1: node: not found
/usr/local/lib
└── (empty)
npm ERR! Linux 4.4.0-51-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "oni-vim"
npm ERR! node v4.2.6
npm ERR! npm v3.5.2
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! [email protected] postinstall: `node install.js`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the [email protected] postinstall script 'node install.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the electron package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node install.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs electron
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls electron
npm ERR! There is likely additional logging output above.
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?
from oni.
@define-private-public - hmm, seems like npm failed to install electron - maybe related to one of these issues?
electron/electron#7007
electron-userland/electron-prebuilt#186
from oni.
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 npm install
as sudo.
npm ERR! addLocal Could not install /usr/local/lib/node_modules/oni-vim/vim/vimfiles/bundle/oni-plugin-typescript
npm ERR! Linux 4.4.0-51-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! node v4.2.6
npm ERR! npm v3.5.2
npm ERR! path /home/ben/.npm/oni-plugin-typescript/0.0.1/package
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall mkdir
npm ERR! Error: EACCES: permission denied, mkdir '/home/ben/.npm/oni-plugin-typescript/0.0.1/package'
npm ERR! at Error (native)
npm ERR! { [Error: EACCES: permission denied, mkdir '/home/ben/.npm/oni-plugin-typescript/0.0.1/package']
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'mkdir',
npm ERR! path: '/home/ben/.npm/oni-plugin-typescript/0.0.1/package' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Please include the following file with any support request:
npm ERR! /usr/local/lib/node_modules/oni-vim/vim/vimfiles/bundle/oni-plugin-typescript/npm-debug.log
npm ERR! Linux 4.4.0-51-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "install:oni-plugin-typescript"
npm ERR! node v4.2.6
npm ERR! npm v3.5.2
npm ERR! code ELIFECYCLE
npm ERR! [email protected] install:oni-plugin-typescript: `cd vim/vimfiles/bundle/oni-plugin-typescript && npm install`
npm ERR! Exit status 243
npm ERR!
npm ERR! Failed at the [email protected] install:oni-plugin-typescript script 'cd vim/vimfiles/bundle/oni-plugin-typescript && npm install'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the oni-vim package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! cd vim/vimfiles/bundle/oni-plugin-typescript && npm install
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs oni-vim
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls oni-vim
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /usr/local/lib/node_modules/oni-vim/npm-debug.log
npm ERR! Linux 4.4.0-51-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "oni-vim"
npm ERR! node v4.2.6
npm ERR! npm v3.5.2
npm ERR! code ELIFECYCLE
npm ERR! [email protected] postinstall: `npm run install:oni-plugin-typescript`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script 'npm run install:oni-plugin-typescript'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the oni-vim package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! npm run install:oni-plugin-typescript
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs oni-vim
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls oni-vim
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/ben/Desktop/npm-debug.log
from oni.
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.
node v7.2.0
npm v4.0.3
It looks like you're using:
node v4.2.6
npm v3.5.2
Is there a reason why you're using older versions?
from oni.
@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.
from oni.
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:
font-family: "Menlo, DejaVu Sans Mono, Lucida Console, monospace"
This would be the order of preferred fonts, where the default monospace
font is the final fallback if none of the other fonts are installed.
I just tried changing MacConfig to:
const MacConfig: any = {
"editor.fontFamily": "Menlo, DejaVu Sans Mono, Lucida Console, monospace",
}
and it seemed to have an effect on Linux (since it's checking for isWindows
). Anyway, just a thought.
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:
font-family:"Consolas,Monaco,Lucida Console,Liberation Mono,DejaVu Sans Mono,Bitstream Vera Sans Mono,Courier New, monospace";
from oni.
@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.
from oni.
For some reason I thought that you couldn't have font fallbacks in the canvas font, but I could very well be mistaken.
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)
from oni.
@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
https://github.com/extr0py/oni/blob/master/browser/src/Renderer/RenderCache.ts
from oni.
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)
from oni.
Related Issues (20)
- Unable to find csproj in golang project HOT 1
- (n)vi(m) in terminal within oni HOT 4
- Rebind regular hjkl motions for moving around globally in Oni's UI HOT 1
- Explorer does not show new files HOT 1
- Oni crashes on LSP call HOT 1
- replace nevim binary with newer
- how to use gopls with oni HOT 1
- Java autocompletion popup displaying wrong suggestion HOT 1
- Fuzzy Finder not working with WSL2 directory HOT 1
- How add support for new language with language server HOT 1
- how to display tabline in Oni? HOT 1
- Oni does not respect editor.quickOpen.execCommand HOT 1
- Adding support for Alt-Shift key bindings HOT 1
- Metals (Scala) language server integration works, but not auto-complete selection
- No file will open on Ubuntu 19.04 HOT 5
- UI freezes for ~10 seconds on :! external commands on Windows HOT 1
- Insiders link in Issue Template is 404'd
- 100%+ CPU spikes when typing colon commands HOT 1
- How to cycle through completions with tab? HOT 1
- Request: add .nix build script HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from oni.