zenity/README.md

77 lines
3.3 KiB
Markdown
Raw Permalink Normal View History

2020-01-09 08:26:58 -05:00
# Zenity dialogs for Golang, Windows and macOS
2021-07-12 09:15:07 -04:00
[![Go Reference](https://pkg.go.dev/badge/image)](https://pkg.go.dev/github.com/ncruces/zenity)
2020-01-29 11:55:51 -05:00
[![Go Report](https://goreportcard.com/badge/github.com/ncruces/zenity)](https://goreportcard.com/report/github.com/ncruces/zenity)
2021-07-12 09:15:07 -04:00
[![Go Cover](https://gocover.io/_badge/github.com/ncruces/zenity)](https://gocover.io/github.com/ncruces/zenity)
2021-07-23 07:17:43 -04:00
[![Mentioned in Awesome Go](https://awesome.re/mentioned-badge.svg)](https://github.com/avelino/awesome-go)
2020-01-09 08:26:58 -05:00
2022-06-23 10:19:00 -04:00
This repo includes:
- a cross-platform [Go](https://go.dev/) package providing
2020-01-26 11:04:49 -05:00
[Zenity](https://help.gnome.org/users/zenity/stable/)-like dialogs
2022-06-23 10:19:00 -04:00
(simple dialogs that interact graphically with the user)
- a *“port”* of the `zenity` command to both Windows and macOS based on that library.
2020-01-09 08:26:58 -05:00
2021-04-09 10:14:31 -04:00
Implemented dialogs:
2020-01-13 21:26:25 -05:00
* [message](https://github.com/ncruces/zenity/wiki/Message-dialog) (error, info, question, warning)
2021-05-04 08:01:04 -04:00
* [text entry](https://github.com/ncruces/zenity/wiki/Text-entry-dialog)
2021-04-11 22:59:08 -04:00
* [list](https://github.com/ncruces/zenity/wiki/List-dialog) (simple)
2021-04-05 18:19:02 -04:00
* [password](https://github.com/ncruces/zenity/wiki/Password-dialog)
2021-04-30 14:19:14 -04:00
* [file selection](https://github.com/ncruces/zenity/wiki/File-selection-dialog)
* [color selection](https://github.com/ncruces/zenity/wiki/Color-selection-dialog)
2022-04-05 08:01:45 -04:00
* [calendar](https://github.com/ncruces/zenity/wiki/Calendar-dialog)
2021-04-30 14:19:14 -04:00
* [progress](https://github.com/ncruces/zenity/wiki/Progress-dialog)
2020-01-27 10:42:43 -05:00
* [notification](https://github.com/ncruces/zenity/wiki/Notification)
2020-01-09 08:26:58 -05:00
2020-01-15 10:06:42 -05:00
Behavior on Windows, macOS and other Unixes might differ slightly.
2020-01-09 08:26:58 -05:00
Some of that is intended (reflecting platform differences),
2021-04-27 20:27:28 -04:00
other bits are unfortunate limitations.
2020-01-09 08:26:58 -05:00
2021-06-07 08:54:18 -04:00
## Installing
The Go package:
go get github.com/ncruces/zenity
2022-05-05 10:49:23 -04:00
The `zenity` command on macOS/WSL using [Homebrew](https://brew.sh/) 🍺:
2021-06-07 08:54:18 -04:00
brew install ncruces/tap/zenity
2022-05-05 10:49:23 -04:00
The `zenity` command on Windows using [Scoop](https://scoop.sh/) 🍨:
2022-05-04 18:22:19 -04:00
scoop install https://ncruces.github.io/scoop/zenity.json
2022-06-23 10:19:00 -04:00
The `zenity` command on macOS/Windows, if you have [Go](https://go.dev/):
2022-04-05 08:01:45 -04:00
go install github.com/ncruces/zenity/cmd/zenity@latest
2021-06-07 08:54:18 -04:00
Or download the [latest release](https://github.com/ncruces/zenity/releases/latest).
2022-06-23 10:19:00 -04:00
## Using
For the Go package, consult the [documentation](https://pkg.go.dev/github.com/ncruces/zenity#section-documentation)
and [examples](https://pkg.go.dev/github.com/ncruces/zenity#pkg-examples).
2020-01-09 08:26:58 -05:00
2022-06-23 10:19:00 -04:00
The `zenity` command does its best to be compatible with the GNOME version.\
Consult the [documentation](https://help.gnome.org/users/zenity/stable/)
and [man page](https://linux.die.net/man/1/zenity) of that command.
## Why?
2020-01-09 08:26:58 -05:00
2022-06-23 10:19:00 -04:00
#### Benefits of the Go package:
2020-01-09 08:26:58 -05:00
* no `cgo` (see [benefits](https://dave.cheney.net/2016/01/18/cgo-is-not-go), mostly cross-compilation)
2020-01-30 21:45:44 -05:00
* no main loop (or any other threading or initialization requirements)
* cancelation through [`context`](https://golang.org/pkg/context/)
2020-01-09 08:26:58 -05:00
* on Windows:
2020-01-09 13:37:03 -05:00
* no additional dependencies
* Explorer shell not required
* works in Server Core
2020-01-09 08:26:58 -05:00
* Unicode support
2021-04-27 20:27:28 -04:00
* High DPI (no manifest required)
* Visual Styles (no manifest required)
2020-01-17 09:23:34 -05:00
* WSL/Cygwin/MSYS2 [support](https://github.com/ncruces/zenity/wiki/Zenity-for-WSL,-Cygwin,-MSYS2)
2020-01-09 08:26:58 -05:00
* on macOS:
2020-01-19 06:57:05 -05:00
* only dependency is `osascript`
2020-01-15 10:06:42 -05:00
* on other Unixes:
2020-01-21 07:03:58 -05:00
* wraps either one of `zenity`, `qarma`, `matedialog`