Readme cleanup

- Drop headings to level 2 (except the top one).
 - Fix Gitter link.
 - Trim example code indent level.
This commit is contained in:
Antti Korpi 2017-07-20 17:07:56 +01:00
parent 6598e75baf
commit f13247ec6d

100
README.md
View file

@ -1,67 +1,65 @@
# About # node-x11
[![Gitter](https://badges.gitter.im/Join\ Chat.svg)](https://gitter.im/sidorares/node-x11?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
X11 protocol client for node.js
Implements core X11 protocol, as well as Xrender, Damage, Composite, Big-Requests, Dpms, Screensaver, XFixes, Shape, XTest, XC-Misc, GLX and Apple-WM extensions. X11 protocol client for Node.js: implements the core X11 protocol, as well as Xrender, Damage, Composite, Big-Requests, Dpms, Screensaver, XFixes, Shape, XTest, XC-Misc, GLX, and Apple-WM extensions.
# install
`npm install x11` [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/sidorares/node-x11?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Build Status](https://secure.travis-ci.org/sidorares/node-x11.png)](http://travis-ci.org/sidorares/node-x11)
## Install
npm install x11
Windows users: Windows users:
1) install [XMing](http://www.straightrunning.com/XmingNotes/) or [Cygwin/X](http://x.cygwin.com/) 1) install [XMing](http://www.straightrunning.com/XmingNotes/) or [Cygwin/X](http://x.cygwin.com/)
2) get node-x11 copy (using [git](http://code.google.com/p/msysgit/downloads/list?can=3) or from [Github](https://github.com/sidorares/node-x11/archives/master )) 2) get node-x11 copy (using [git](http://code.google.com/p/msysgit/downloads/list?can=3) or from [Github](https://github.com/sidorares/node-x11/archives/master ))
#CI build status: ## Example
[![Build Status](https://secure.travis-ci.org/sidorares/node-x11.png)](http://travis-ci.org/sidorares/node-x11)
# example
Core requests usage: Core requests usage:
```js ```js
var x11 = require('x11'); var x11 = require('x11');
var Exposure = x11.eventMask.Exposure; var Exposure = x11.eventMask.Exposure;
var PointerMotion = x11.eventMask.PointerMotion; var PointerMotion = x11.eventMask.PointerMotion;
x11.createClient(function(err, display) { x11.createClient(function(err, display) {
if (!err) { if (!err) {
var X = display.client; var X = display.client;
var root = display.screen[0].root; var root = display.screen[0].root;
var wid = X.AllocID(); var wid = X.AllocID();
X.CreateWindow( X.CreateWindow(
wid, root, // new window id, parent wid, root, // new window id, parent
0, 0, 100, 100, // x, y, w, h 0, 0, 100, 100, // x, y, w, h
0, 0, 0, 0, // border, depth, class, visual 0, 0, 0, 0, // border, depth, class, visual
{ eventMask: Exposure|PointerMotion } // other parameters { eventMask: Exposure|PointerMotion } // other parameters
); );
X.MapWindow(wid); X.MapWindow(wid);
var gc = X.AllocID(); var gc = X.AllocID();
X.CreateGC(gc, wid); X.CreateGC(gc, wid);
X.on('event', function(ev) { X.on('event', function(ev) {
if (ev.type == 12) if (ev.type == 12)
{ {
X.PolyText8(wid, gc, 50, 50, ['Hello, Node.JS!']); X.PolyText8(wid, gc, 50, 50, ['Hello, Node.JS!']);
} }
}); });
X.on('error', function(e) { X.on('error', function(e) {
console.log(e); console.log(e);
}); });
} else { } else {
console.log(err); console.log(err);
} }
}); });
``` ```
# Screenshots ## Screenshots
![tetris game](https://lh6.googleusercontent.com/-RCRY9A7WwnA/Tlww0FHP7NI/AAAAAAAAAwo/nxfSxsw6xow/s400/tetris.png) ![tetris game](https://lh6.googleusercontent.com/-RCRY9A7WwnA/Tlww0FHP7NI/AAAAAAAAAwo/nxfSxsw6xow/s400/tetris.png)
![XRENDER gradients](https://lh4.googleusercontent.com/-VS0BMYYmq6M/Tlww0Y1ij0I/AAAAAAAAAws/pVWsPZ63Yeo/s400/render-gradients.png) ![XRENDER gradients](https://lh4.googleusercontent.com/-VS0BMYYmq6M/Tlww0Y1ij0I/AAAAAAAAAws/pVWsPZ63Yeo/s400/render-gradients.png)
![OpenGL glxgears](http://img-fotki.yandex.ru/get/4123/37511094.30/0_81712_6c2ebb11_L) ![OpenGL glxgears](http://img-fotki.yandex.ru/get/4123/37511094.30/0_81712_6c2ebb11_L)
![OpenGL teapot](http://img-fotki.yandex.ru/get/4132/37511094.30/0_81713_82a5ac48_L) ![OpenGL teapot](http://img-fotki.yandex.ru/get/4132/37511094.30/0_81713_82a5ac48_L)
# In use ## In use
- [ntk](https://github.com/sidorares/ntk) - higher level toolkit on top of X11 - [ntk](https://github.com/sidorares/ntk) - higher level toolkit on top of X11
- [node-remote](https://github.com/AndrewSwerlick/node-remote) - media center controller - [node-remote](https://github.com/AndrewSwerlick/node-remote) - media center controller
- [tiles](https://github.com/dominictarr/tiles) - tiling window manager - [tiles](https://github.com/dominictarr/tiles) - tiling window manager
@ -74,7 +72,7 @@ Core requests usage:
- [tinywm](https://github.com/Airblader/node-tinywm) The famous [TinyWM](https://github.com/mackstann/tinywm) written in node.js - [tinywm](https://github.com/Airblader/node-tinywm) The famous [TinyWM](https://github.com/mackstann/tinywm) written in node.js
- [basedwm](https://github.com/anko/basedwm) Infinite-desktop panning X window manager in LiveScript - [basedwm](https://github.com/anko/basedwm) Infinite-desktop panning X window manager in LiveScript
# X11 resources/documentation: ## X11 resources/documentation:
- [Xplain](https://github.com/magcius/xplain) - A series of articles to help explain the X Window System http://magcius.github.io/xplain/article/ - [Xplain](https://github.com/magcius/xplain) - A series of articles to help explain the X Window System http://magcius.github.io/xplain/article/
- [Official X11 docs](http://www.x.org/releases/X11R7.6/doc/) - [Official X11 docs](http://www.x.org/releases/X11R7.6/doc/)
@ -83,7 +81,7 @@ Core requests usage:
- [How to write composite manager](http://www.talisman.org/~erlkonig/misc/x11-composite-tutorial/) - [How to write composite manager](http://www.talisman.org/~erlkonig/misc/x11-composite-tutorial/)
- [Extended Window Manager Hints specification](http://standards.freedesktop.org/wm-spec/wm-spec-1.3.html) - [Extended Window Manager Hints specification](http://standards.freedesktop.org/wm-spec/wm-spec-1.3.html)
# Other implementations ## Other implementations
- C: XLib - http://www.sbin.org/doc/Xlib/ http://www.tronche.com/gui/x/xlib/ http://www.x.org/docs/X11/xlib.pdf - C: XLib - http://www.sbin.org/doc/Xlib/ http://www.tronche.com/gui/x/xlib/ http://www.x.org/docs/X11/xlib.pdf
- C: XCB - http://xcb.freedesktop.org/ - C: XCB - http://xcb.freedesktop.org/
@ -98,9 +96,9 @@ Core requests usage:
- Guile: https://github.com/mwitmer/guile-xcb - Guile: https://github.com/mwitmer/guile-xcb
- Emacs lisp: https://github.com/ch11ng/xelb ( autogenerated from XCB XML ) - Emacs lisp: https://github.com/ch11ng/xelb ( autogenerated from XCB XML )
# Server side (protocol + functionality) implementations for js + DOM ## Server side (protocol + functionality) implementations for js + DOM
would be really great to make completely web based playground page, connecting node-x11 api to DOM based implementation would be really great to make completely web based playground page, connecting node-x11 api to DOM based implementation
- https://github.com/GothAck/javascript-x-server - https://github.com/GothAck/javascript-x-server
- https://github.com/ttaubert/x-server-js - https://github.com/ttaubert/x-server-js