v0.3.0 2df0761

README.md RawHistoryFolder

neferclient

A Wayland client toolkit library for Go: connection, outputs, surface roles, seat and DMA-BUF presentation. It does not render and holds no application policy. No cgo required.

[!WARNING] Early development. No release yet. Expect bugs and breaking changes.

Requirements

  • Linux, kernel 6.6 or newer (DRM syncobj eventfd).
  • A compositor advertising zwp_linux_dmabuf_v1 (v4) and wp_linux_drm_syncobj_manager_v1.
  • libxkbcommon at runtime for keyboard input.

Usage

The library does not render. The examples module pairs it with NeferGUI (a pure graphics library with no Wayland code); the two never import each other, and the examples copy plain fields between them. The loop runs on one owner goroutine:

conn, err := neferclient.Connect(ctx, "")
if err != nil {
	return fmt.Errorf("connect: %w", err)
}
defer conn.Close()
surf, err := conn.NewLayerSurface(neferclient.LayerConfig{Level: neferclient.LayerTop, Width: 240, Height: 90})
if err != nil {
	return fmt.Errorf("layer surface: %w", err)
}
for {
	select {
	case <-conn.Wake():
		if err := conn.Dispatch(handler); err != nil { // Configure, FeedbackDone, Frame, Pointer, Key, FDReady...
			return fmt.Errorf("dispatch: %w", err)
		}
	case <-ctx.Done():
		return nil
	}
	// render with NeferGUI, then surf.ImportBuffer / surf.ImportTimeline / surf.Present
}
  • examples/layer: a layer surface with a counter button.
  • examples/lock: a session lock with a masked password field. It is a demo and authenticates nothing; read its header before running it.

Run them against a compositor with cd examples && go run ./layer. make examples-check builds, vets and lints them; the headless test needs a NeferWL binary: cd examples && NEFERCLIENT_HEADLESS=/usr/sbin/neferwl go test -run Headless ./....

License

MIT

source
1# neferclient
2
3A Wayland client toolkit library for Go: connection, outputs, surface roles, seat and DMA-BUF presentation. It does not render and holds no application policy. No cgo required.
4
5> [!WARNING]
6> **Early development.** No release yet. Expect bugs and breaking changes.
7
8## Requirements
9
10- Linux, kernel 6.6 or newer (DRM syncobj eventfd).
11- A compositor advertising `zwp_linux_dmabuf_v1` (v4) and `wp_linux_drm_syncobj_manager_v1`.
12- `libxkbcommon` at runtime for keyboard input.
13
14## Usage
15
16The library does not render. The `examples` module pairs it with [NeferGUI](https://github.com/bnema/nefergui) (a pure graphics library with no Wayland code); the two never import each other, and the examples copy plain fields between them. The loop runs on one owner goroutine:
17
18```go
19conn, err := neferclient.Connect(ctx, "")
20if err != nil {
21	return fmt.Errorf("connect: %w", err)
22}
23defer conn.Close()
24surf, err := conn.NewLayerSurface(neferclient.LayerConfig{Level: neferclient.LayerTop, Width: 240, Height: 90})
25if err != nil {
26	return fmt.Errorf("layer surface: %w", err)
27}
28for {
29	select {
30	case <-conn.Wake():
31		if err := conn.Dispatch(handler); err != nil { // Configure, FeedbackDone, Frame, Pointer, Key, FDReady...
32			return fmt.Errorf("dispatch: %w", err)
33		}
34	case <-ctx.Done():
35		return nil
36	}
37	// render with NeferGUI, then surf.ImportBuffer / surf.ImportTimeline / surf.Present
38}
39```
40
41- [`examples/layer`](examples/layer): a layer surface with a counter button.
42- [`examples/lock`](examples/lock): a session lock with a masked password field. It is a demo and authenticates nothing; read its header before running it.
43
44Run them against a compositor with `cd examples && go run ./layer`. `make examples-check` builds, vets and lints them; the headless test needs a NeferWL binary: `cd examples && NEFERCLIENT_HEADLESS=/usr/sbin/neferwl go test -run Headless ./...`.
45
46## License
47
48MIT

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 4

↑↓ moveenter openesc close