Go SDK for Pocketbook
Fix Dockerfile with new include paths


browse  log 



You can also use your local clone with git send-email.

#Go SDK for Pocketbook

Under construction! Don't use now!

Unofficial Go SDK for Pocketbook based on libinkview.

Supports graphical user interfaces and CLI apps.

Forked from github.com/dennwc/inkview

Submit tickets to todo.sr.ht/~ghost08/ink, or via mail ~ghost08/ink@todo.sr.ht.

Submit patches to lists.sr.ht/~ghost08/ink, or via mail ~ghost08/ink@lists.sr.ht.


For your convenience there is a docker-compose.yaml.

git clone https://git.sr.ht/~ghost08/ink
cd ink
docker-compose build

will create a container (it will take a while), which can be used to compile a go program.

#Build an app with UI

Example code (myawesomeapp.go):

package main

import (


var (
	f *font.Font

func main() {
	go eventLoop()

func eventLoop() {
	for e := range ink.Events() {
		switch e := e.(type) {
		case ink.InitEvent:
			f = font.OpenFont("LiberationSans", 200, false)
		case ink.ShowEvent:
			gtx := layout.NewContext(e)
				Font:  f,
				Color: color.Black,
				Text:  'Hello World",

(also use the go mod init and go mod tidy stuff)

To build your app run (requires Docker):

docker run --rm -v $PWD:/app ghost08/pocketbook-go-sdk build -o myawesomeapp.app

To run an binary, copy it into applications/myawesomeapp.app folder on the device and it should appear in the applications list.

#Notes on networking

By default, device will try to shutdown network interface to save battery. So before making a network call use:

func makeHttpCall(url string) error {
	if err := ink.NetConnect(""); err != nil {
		return err
	defer ink.NetDisconnect()
	res, err := http.Get(url)
	if err != nil {
		return err
	//Do something with response
	return nil

Also note that establishing TLS will require Go to read system certificate pool that might take up to 30 sec on some devices and will lead to TLS handshake timeouts. You will need to call InitCerts first to fix the problem.

IPv6 is not enabled on some devices, thus a patch to Go DNS lib is required to skip lookup on IPv6 address (SDK already includes the patch). Similar problems may arise when trying to dial IPv6 directly.