Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gumieri/go-sway
https://github.com/gumieri/go-sway
Last synced: 15 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/gumieri/go-sway
- Owner: gumieri
- License: other
- Created: 2019-03-26T01:16:36.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-03-26T02:02:43.000Z (almost 6 years ago)
- Last Synced: 2024-12-08T07:42:49.734Z (17 days ago)
- Language: Go
- Size: 56.6 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Disclaimer
Hi! I'm happy you're here. This project is very much in its early stages; so use
with caution and please file issues and pull requests as you please. Basically,
so far, I've just forked go.i3wm.org/i3.git and replaced every instance of "i3"
with "sway."Your help is appreciated! I'm happy to maintain this library.
# go-sway
[![Build Status](https://travis-ci.org/i3/go-i3.svg?branch=master)](https://travis-ci.org/i3/go-i3)
[![Go Report Card](https://goreportcard.com/badge/go.i3wm.org/i3)](https://goreportcard.com/report/go.i3wm.org/i3)
[![GoDoc](https://godoc.org/github.com/gumieri/go-sway?status.svg)](https://godoc.org/github.com/gumieri/go-sway)Package sway provides a convenient interface to the sway window manager via [its IPC
interface](https://i3wm.org/docs/ipc.html).See [its documentation](https://godoc.org/github.com/gumieri/go-sway) for more details.
## Advantages over other sway IPC packages
Here comes a grab bag of features to which we paid attention. At the time of
writing, most other sway IPC packages lack at least a good number of these
features:* Retries are transparently handled: programs using this package will recover
automatically from in-place sway restarts. Additionally, programs can be started
from xsession or user sessions before sway is even running.* Version checks are transparently handled: if your program uses features which
are not supported by the running sway version, helpful error messages will be
returned at run time.* Comprehensive: the entire documented IPC interface of the latest stable sway
version is covered by this package. Tagged releases match sway’s major and minor
version.* Consistent and familiar: once familiar with the sway IPC protocol’s features,
you should have no trouble matching the documentation to API and vice-versa.* Good test coverage (hard to display in a badge, as our multi-process setup
breaks `go test`’s `-coverprofile` flag).* Implemented in pure Go, without resorting to the `unsafe` package.
* Works on little and big endian architectures.
## Scope
sway’s entire documented IPC interface is available in this package.
In addition, helper functions which are useful for a broad range of programs
(and only those!) are provided, e.g. Node’s FindChild and FindFocused.Packages which introduce higher-level abstractions should feel free to use this
package as a building block.## Assumptions
* The `sway(1)` binary must be in `$PATH` so that the IPC socket path can be retrieved.
* For transparent version checks to work, the running sway version must be ≥ 4.3 (released 2012-09-19).## Testing
Be sure to include the target sway version (the most recent stable release) in
`$PATH` and use `go test` as usual:```shell
PATH=~/i3/build/i3:$PATH go test -v github.com/harrisonthorne/go-sway
```