• Stars
    star
    131
  • Rank 275,867 (Top 6 %)
  • Language
    Go
  • License
    MIT License
  • Created over 4 years ago
  • Updated about 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Winman - go Window Manager for terminal UIs

Build Status Go Report Godoc Reference

Winman is a basic yet powerful window manager in go for terminal-based user interfaces that plugs into tview.

Screenshot

It supports floating windows that can be dragged, resized and maximized. Windows can have buttons on the title bar, for example to close them, help commands or maximize / minimize.

Windows can also be modal, meaning that other windows don't receive input while a modal window is on top. You can control whether the user can drag or resize windows around the screen.

Windows can overlap each other by setting their Z-index. Any tview.Primitive can be added to a window, thus you can combine with any other existing tview widget! Check tview for a complete list of available widgets you can use.

Installation

go get github.com/epiclabs-io/winman

Hello world

package main

import (
	"github.com/epiclabs-io/winman"
	"github.com/rivo/tview"
)

func main() {

	app := tview.NewApplication()
	wm := winman.NewWindowManager()

	content := tview.NewTextView().
		SetText("Hello, world!").       // set content of the text view
		SetTextAlign(tview.AlignCenter) // align text to the center of the text view

	window := wm.NewWindow(). // create new window and add it to the window manager
					Show().                   // make window visible
					SetRoot(content).         // have the text view above be the content of the window
					SetDraggable(true).       // make window draggable around the screen
					SetResizable(true).       // make the window resizable
					SetTitle("Hi!").          // set the window title
					AddButton(&winman.Button{ // create a button with an X to close the application
			Symbol:  'X',
			OnClick: func() { app.Stop() }, // close the application
		})

	window.SetRect(5, 5, 30, 10) // place the window

	// now, execute the application:
	if err := app.SetRoot(wm, true).EnableMouse(true).Run(); err != nil {
		panic(err)
	}
}

hello world

Documentation

Refer to https://pkg.go.dev/github.com/epiclabs-io/winman for the package's documentation. The demos directory contains a showcase demonstrating the different aspects of this library

Dependencies

This package works with tview and its dependencies.

Your Feedback

Add your issue here on GitHub. Feel free to get in touch if you have any questions.

Author(s)

This package is written and maintained by Javier Peletier (@jpeletier) - Epic Labs

More Repositories

1

hls-analyzer

Analyzer for HTTP Live Streams (HLS) content
Python
183
star
2

epic-video-comparator

Javascript library which implements a video comparator component: two overlaped and synchronized video players each one playing an independent source.
TypeScript
83
star
3

inspector.js

Javascript Library that implements MpegTS, MP4 and WebM demuxers.
TypeScript
35
star
4

elastic

Converts go types no matter what
Go
23
star
5

diff3

diff3go 3-way diff in go
Go
11
star
6

docker-cucumber-protractor-chrome

Docker image to run cucumber protractor tests in headless chrome
JavaScript
8
star
7

angular-dashjs-player

Angular 6.0 wrapper for Dash.js player
TypeScript
6
star
8

browser-media-support

Check Media Source Extensions (MSE) and Encrypted Media Extensions support (EME)
TypeScript
6
star
9

swarm-samples

Collection of Swarm-related code snippets and examples
JavaScript
5
star
10

ngx-epic-video-player-demo

TypeScript
5
star
11

esphome-modbus-server

ESPHome Modbus Server component
C++
3
star
12

node-video-duration

NodeJs module that retrieves the duration of video/audio assets
JavaScript
3
star
13

macbook-facetimehd

Ubuntu driver install script for Macbook Pro
Shell
2
star
14

DeepAudioClassification

Jupyter Notebook
2
star
15

epic-video-player

JS library to wrap different video libraries.
TypeScript
2
star
16

epicmdns

mdns module for CoreDNS
Go
1
star
17

etherdune

EtherDune - Easy and extensible Arduino TCP/IP library
C++
1
star
18

tomcatjs

Nodejs library to interface with Tomcat Manager
TypeScript
1
star
19

beyondTheWallboard

Chrome extension to create a slideshow with the opened tabs.
JavaScript
1
star
20

epic-chatbot

ML Chatbot model trainer with tuits and Cornell databse movie. Also api service to use it
Python
1
star
21

YT8M

(Machine) Learning from YouTube8M dataset
Jupyter Notebook
1
star
22

across

Arduino/x86 cross-compile toolkit and runtime
C++
1
star