Skip to content

Latest commit

 

History

History
81 lines (55 loc) · 2.53 KB

README.md

File metadata and controls

81 lines (55 loc) · 2.53 KB

Tooey

example workflow Go Coverage Go Report Card

Tooey is a cross-platform and customizable terminal dashboard and widget library built on top of tcell (formerly termbox-go pre-fork). This project started as a fork of the fantastic termui but then turned into a ground-up rewrite.

See FORK.MD for details of the original fork and README.md

demo of flex containers cast under Ubuntu Linux; Alacritty

Features

  • 24bit colors enabled by TCell
    • Requires your $TERM to end in -truecolor Tcell Docs
    • Falls back to 256 color otherwise
  • Flex-inspired layout engine with Container
  • Several premade widgets for common use cases
  • Easily create custom widgets by extending Element
  • Position widgets either in containers with flex-like layout or with absolute coordinates
  • Keyboard, mouse, and terminal resizing events < UNDER REWORK >
  • Colors, Styling, Theming < UNDER REWORK >

Installation

go mod init

go get github.com/asciifaceman/tooey

go mod tidy after first reference

Hello World

package main

import (
	"log"

	"github.com/asciifaceman/tooey"
	"github.com/asciifaceman/tooey/widgets"
)

func main() {
	if err := tooey.Init(); err != nil {
		log.Fatalf("failed to initialize tooey: %v", err)
	}
	defer tooey.Close()

	p := widgets.NewText()
	p.SetTheme(themes.ThemeRetroTerminalOrange)
	p.Title.Content = "Text Title"
	p.Content = "Hello World!"
	p.SetRect(0, 0, 25, 5)

	tooey.Render(p)

	time.Sleep(time.Duration(time.Second * 5)) // events returning soon
}

Widgets

Run an example with go run _examples/{example}.go or run each example consecutively with make run-examples.

Documentation

License

MIT

Authors