• Stars
    star
    958
  • Rank 47,718 (Top 1.0 %)
  • Language
    Go
  • License
    Do What The F*ck ...
  • Created almost 13 years ago
  • Updated over 2 years ago

Reviews

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

Repository Details

A fully-featured window manager written in Go.

NOTE: This repository is in maintenance mode. Wingo is still used every day, but because there are no tests, it is impossible to add new functionality. Therefore, I will only be doing work on Wingo required to make it work.

Wingo is an X window manager written in pure Go. All of its dependencies, from communicating with X up to drawing text on windows, are also in Go. Wingo is mostly ICCCM and EWMH compliant (see COMPLIANCE).

If you have Go installed and configured on your machine, all you need to do is: (For Archlinux users, Wingo is in the AUR.)

go get github.com/BurntSushi/wingo

And in your $HOME/.xinitrc:

exec wingo

Or if you're brave and are using a desktop environment, just run this to replace your current window manager: (Seriously though, save you work. Wingo is still very alpha.)

wingo --replace

Help

You can find me in the #wingo IRC channel on FreeNode.

My triple head setup

Triple head with Wingo

Dude... why?

Wingo has two features which, when combined, set it apart from other window managers (maybe):

  1. Support for both floating and tiling placement policies. Wingo can be used as a regular floating (stacking) window manager, complete with decorations, maximization, sticky windows, and most other things you might find in a window manager. Wingo can also be switched into a tiling mode where window decorations disappear, and windows are automatically managed via tiling.

  2. Workspaces per monitor. In a multi-head setup, each monitor can display its own workspace---independent of the other monitors. This makes changing your view of windows in multi-head setups much easier than in most other window managers, which will only allow you to see one workspace stretched across all of your monitors. Also, since placement policies like floating and tiling affect workspaces, this makes it possible for one monitor to be tiling while another is floating!

WARNING: The major drawback of using a workspaces per monitor model is that it violates an implicit assumption made by EWMH: that one and only one workspace may be viewable at any point in time. As a result, in multi-head setups, pagers and taskbars may operate in confusing ways. In a single head setup, they should continue to operate normally. Wingo provides prompts that allow you to add/remove workspaces and select clients that may alleviate the need for pagers or taskbars.

Configuration

Wingo is extremely configurable. This includes binding any of a vast number of commands to key or mouse presses, theming your window decorations and setting up hooks that will fire depending upon a set of match conditions.

All configuration is done using an INI like file format with support for simple variable substitution (which makes theming a bit simpler). No XML. No recompiling. No scripting.

A fresh set of configuration files can be added to $HOME/.config/wingo with

wingo --write-config

Each configuration file is heavily documented.

Configuring key/mouse bindings and hooks uses a central command system called Gribble. For example, one can add a workspace named "cromulent" with this command:

AddWorkspace "cromulent"

But that's not very flexible, right? It'd be nice if you could specify the name of workspace on the fly... For this, simply use the "Input" command as an argument to AddWorkspace, which shows a graphical prompt and allows you to type in a name:

AddWorkspace (Input "Enter your workspace name:")

The text entered into the input box will be passed to the AddWorkspace command.

Please see the HOWTO-COMMANDS file for more info. We've barely scratched the surface.

Scripting Wingo

So I lied earlier. You can kind of script Wingo by using its IPC mechanism. You'll need to make sure that wingo-cmd is installed:

go get github.com/BurntSushi/wingo/wingo-cmd

While Wingo is running, you can send any command you like:

wingo-cmd 'AddWorkspace "embiggen"'

Or perhaps you can't remember how to use the AddWorkspace command:

wingo-cmd --usage AddWorkspace

Which will print the parameters, their types and a description of the command.

Want to pipe some information to another program? No problem, since commands can return stuff!

wingo-cmd GetWorkspace

And you can even make commands repeat themselves every X milliseconds, which is ideal for use with something like dzen to show the name of the currently active window:

wingo-cmd --poll 500 'GetClientName (GetActive)' | dzen2

Finally, you can see a list of all commands, their parameters and their usage: (even if Wingo isn't running)

wingo-cmd --list-usage

(Wingo actually can provide enough information for ambitious hackers to script their own layouts in whatever programming language they like without ever having to deal with X at all. Assuming it has support for connecting to unix domain sockets. Or you could just use a shell with 'wingo-cmd' if you're into that kind of tomfoolery.)

Workspaces

Having some set number of workspaces labeled 1, 2, 3, 4, ... is a thing of the past. While Wingo won't stop you from using such a simplistic model, it will egg you on to try something else: dynamic workspaces.

Dynamic workspaces takes advantage of two things: workspace names and adding/removing workspaces as you need them.

This is something that I find useful since I'm typically working on multiple projects, and my needs change as I work on them. For example, when working on Wingo, I might add the "wingo" workspace, along with the "xephyr" workspace and the "gribble" workspace. When I'm done, I can remove those and add other workspaces for my next project. Or I can leave those workspaces intact for when I come back to them later.

With Wingo, such a workflow is natural because you're no longer confined to "removing only the last workspace" or some other such nonsense. Plus, adding a workspace requires that you name it---so workspaces always carry some semantic meaning.

(N.B. I don't mean to imply that this model is new, just uncommon; particularly among floating window managers. I've personally taken the model from xmonad-contrib's DynamicWorkspaces module.)

Tiling layouts

Right now, only simple tiling layouts are available. (Vertical and Horizontal.) Mostly because those are the layouts that I primarily use. I'll be adding more as they are demanded.

Ummm... manual tiling?

I'd actually love to add this to Wingo. It's slightly more complex than automatic tiling layouts, because it introduces the concept of containers, which is something that Wingo knows nothing about. Namely, a container can hold zero or more windows and an empty container may have focus.

Why doesn't Wingo have..?

Tags

Another popular workspace model (particularly among tiling window managers) is tagging a window with one or more workspaces.

Not only do I find this needlessly complex, but it doesn't really make sense in a model where more than one workspace can be visible in multi-head setups.

Shaded windows

This is in Openbox, but not Wingo. Honestly, I just never use it. I'm not really opposed to them, though.

Tabbed windows

The thought of programming the decorations for this scares me. This, like manual tiling, would also require that Wingo have a notion of containers (which it doesn't).

Compositing

Bandwidth allotment exceeded. Seriously.

If an ambitious person wanted to run with it, that's fine, but there are serious hurdles. The most pertinent one is mixing OpenGL with the pure X Go Binding. I am not sure how to do it.

One could use the X RENDER extension, but I think everyone hates that.

Wayland

I have done a non-trivial amount of research into Wayland (but not a big amount) and there are serious hurdles to overcome before Go can work with the Wayland protocol in a practical way. Namely, while a pure Go binding could be written easily enough, it would be forced into software compositing---which could be too slow. In order to do hardware compositing, I think you need OpenGL (specifically, EGL), which links against the libwayland libraries. (Yeah, that's a recursive dependency. Wooho.)

Plus, in order to use Wayland, Wingo would need a compositing backend (along with every other non-compositing X11 window manager). This is also not an easy task.

Supposedly there are some ideas for plans floating around that would let non-compositing X window managers to "plug into" the Wayland reference compositor (Weston). When this will be possible (or even if it will be possible with a window manager written in Go) remains to be seen.

If I am in err (and this is quite likely; my OpenGL knowledge is limited), please ping me.

Dependencies

You really should be using the 'go' tool to install Wingo, and therefore shouldn't care about dependencies. But I'll list them anyway---with many thanks to the authors (well, the ones that aren't me anyway).

Inspiration

Wingo is heavily inspired by Openbox and Xmonad. Basically, Openbox's floating semantics (although most window managers are the same in this regard) and Xmonad's automatic tiling style plus its workspace model (workspaces per monitor). I've also adopted Xmonad's "greedy" workspace switching and embedded the concepts from the "DynamicWorkspaces" contrib library into the Gribble command system.

Go your own way

Wingo is actually split up into many sub-packages. It is possible (but not necessarily likely) that you could pick out some of these sub-packages and use them in your own window manager. The packages of particular interest are probably the ones that do the most nitty gritty X stuff---especially relating to drawing windows. Here's a quick run down of those:

cursors

Sets up some plain old X cursors. Not very interesting.

prompt

Provides several different kinds of prompt windows that can take user input. These should actually work in an existing window manager. (See the examples in the package directory.) Prompt requires both the 'render' and 'text' Wingo packages.

render

Renders some very basic shapes and gradients to X windows.

text

Renders text to windows. Also provides a special window type that can act as a text box for user input.

Others

The only other package worth mentioning is 'frame'. It's probably too monolithic to be used in another window manager (unless you really like Wingo's decorations), but it's possible that it could serve as a half-decent template for your own frames.

The rest of the sub-packages (excluding xclient and wm, since they are very Wingo specific) could also be used, particularly since only minimal Client interfaces are required. However, most of them aren't that complex and therefore probably aren't worth it. And the ones that do have some complexity (maybe 'heads' and 'workspace') aren't packages that I'm particularly proud of.

Also, if you're wanting to make a Go window manager, my xgbutil package (separate from Wingo) will be a big help. Feel free to ping me.

My past X work

There's too much. The highlights are pytyle and Openbox Multihead.

For more: http://burntsushi.net/x11/

More Repositories

1

ripgrep

ripgrep recursively searches directories for a regex pattern while respecting your gitignore
Rust
48,517
star
2

xsv

A fast CSV command line toolkit written in Rust.
Rust
10,377
star
3

toml

TOML parser for Golang with reflection.
Go
4,464
star
4

quickcheck

Automated property based testing for Rust (with shrinking).
Rust
2,408
star
5

erd

Translates a plain text description of a relational database schema to a graphical entity-relationship diagram.
Haskell
1,805
star
6

fst

Represent large sets and maps compactly with finite state transducers.
Rust
1,771
star
7

jiff

A date-time library for Rust that encourages you to jump into the pit of success.
Rust
1,736
star
8

rust-csv

A CSV parser for Rust, with Serde support.
Rust
1,710
star
9

walkdir

Rust library for walking directories recursively.
Rust
1,283
star
10

nflgame

An API to retrieve and read NFL Game Center JSON data. It can work with real-time data, which can be used for fantasy football.
Python
1,257
star
11

nfldb

A library to manage and update NFL data in a relational database.
Python
1,079
star
12

aho-corasick

A fast implementation of Aho-Corasick in Rust.
Rust
1,028
star
13

byteorder

Rust library for reading/writing numbers in big-endian and little-endian.
Rust
980
star
14

memchr

Optimized string search routines for Rust.
Rust
888
star
15

bstr

A string type for Rust that is not required to be valid UTF-8.
Rust
795
star
16

advent-of-code

Rust solutions to AoC 2018
Rust
479
star
17

xgb

The X Go Binding is a low-level API to communicate with the X server. It is modeled on XCB and supports many X extensions.
Go
472
star
18

termcolor

Cross platform terminal colors for Rust.
Rust
462
star
19

rust-snappy

Snappy compression implemented in Rust (including the Snappy frame format).
Rust
449
star
20

go-sumtype

A simple utility for running exhaustiveness checks on Go "sum types."
Go
421
star
21

chan

Multi-producer, multi-consumer concurrent channel for Rust.
Rust
392
star
22

regex-automata

A low level regular expression library that uses deterministic finite automata.
Rust
352
star
23

cargo-benchcmp

A small utility to compare Rust micro-benchmarks.
Rust
342
star
24

suffix

Fast suffix arrays for Rust (with Unicode support).
Rust
262
star
25

rure-go

Go bindings to Rust's regex engine.
Go
250
star
26

tabwriter

Elastic tabstops for Rust.
Rust
247
star
27

rebar

A biased barometer for gauging the relative speed of some regex engines on a curated set of tasks.
Python
227
star
28

imdb-rename

A command line tool to rename media files based on titles from IMDb.
Rust
226
star
29

critcmp

A command line tool for comparing benchmarks run by Criterion.
Rust
216
star
30

ty

Easy parametric polymorphism at run time using completely unidiomatic Go.
Go
198
star
31

xgbutil

A utility library to make use of the X Go Binding easier. (Implements EWMH and ICCCM specs, key binding support, etc.)
Go
191
star
32

pytyle3

An updated (and much faster) version of pytyle that uses xpybutil and is compatible with Openbox Multihead.
Python
181
star
33

dotfiles

My configuration files and personal collection of scripts.
Vim Script
154
star
34

rsc-regexp

Translations of a simple C program to Rust.
Rust
138
star
35

rust-cbor

CBOR (binary JSON) for Rust with automatic type based decoding and encoding.
Rust
129
star
36

chan-signal

Respond to OS signals with channels.
Rust
125
star
37

goim

Goim is a robust command line utility to maintain and query the Internet Movie Database (IMDb).
Go
117
star
38

same-file

Cross platform Rust library for checking whether two file paths are the same file.
Rust
101
star
39

clibs

A smattering of miscellaneous C libraries. Includes sane argument parsing, a thread-safe multi-producer/multi-consumer queue, and implementation of common data structures (hashmaps, vectors and linked lists).
C
98
star
40

ucd-generate

A command line tool to generate Unicode tables as source code.
Rust
95
star
41

nflvid

An experimental library to map play meta data to footage of that play.
Python
91
star
42

rust-stats

Basic statistical functions on streams for Rust.
Rust
87
star
43

migration

Package migration for Golang automatically handles versioning of a database schema by applying a series of migrations supplied by the client.
Go
81
star
44

winapi-util

Safe wrappers for various Windows specific APIs.
Rust
64
star
45

xpybutil

An incomplete xcb-util port plus some extras
Python
62
star
46

graphics-go

Automatically exported from code.google.com/p/graphics-go
Go
60
star
47

rust-pcre2

High level Rust bindings to PCRE2.
C
56
star
48

blog

My blog.
Rust
52
star
49

rust-sorts

Implementations of common sorting algorithms in Rust with comprehensive tests and benchmarks.
Rust
51
star
50

openbox-multihead

Openbox with patches for enhanced multihead support.
C
46
star
51

nakala

A low level embedded information retrieval system.
Rust
45
star
52

nflfan

View your fantasy teams with nfldb using a web interface.
JavaScript
43
star
53

globset

A globbing library for Rust.
Rust
42
star
54

utf8-ranges

Convert contiguous ranges of Unicode codepoints to UTF-8 byte ranges.
Rust
42
star
55

rtmpdump-ksv

rtmpdump with ksv's patch. Intended to track upstream git://git.ffmpeg.org/rtmpdump as well.
C
40
star
56

regexp

A regular expression library implemented in Rust.
Rust
37
star
57

xdg

A Go package for reading config and data files according to the XDG Base Directory specification.
Go
35
star
58

locker

A simple Golang package for conveniently using named read/write locks. Useful for synchronizing access to session based storage in web applications.
Go
34
star
59

nflcmd

A collection of command line utilities for viewing NFL statistics and rankings with nfldb.
Python
32
star
60

notes

A collection of small notes that aren't appropriate for my blog.
31
star
61

mempool

A fast thread safe memory pool for reusing allocations.
Rust
29
star
62

gribble

A command oriented language whose environment is defined through Go struct types by reflection.
Go
28
star
63

vcr

A simple wrapper tool around ffmpeg to capture video from a VCR.
Rust
27
star
64

encoding_rs_io

Streaming I/O adapters for the encoding_rs crate.
Rust
25
star
65

rust-cmail

A simple command line utility for periodically sending email containing the output of long-running commands.
Rust
21
star
66

cluster

A simple API for managing a network cluster with smart peer discovery.
Go
19
star
67

pager-multihead

A pager that supports per-monitor desktops (compatible with Openbox Multihead and Wingo)
Python
15
star
68

cablastp

Performs BLAST on compressed proteomic data.
Go
15
star
69

rust-error-handling-case-study

Code for the case study in my blog post: http://blog.burntsushi.net/rust-error-handling
Rust
15
star
70

rg-cratesio-typosquat

The source code of the 'rg' crate. It is an intentional typo-squat that redirects folks to 'ripgrep'.
Rust
15
star
71

imgv

An image viewer for Linux written in Go.
Go
14
star
72

cmd

A convenience library for executing commands in Go, including executing commands in parallel with a pool.
Go
14
star
73

fanfoot

View your fantasy football leagues and get text alerts when one of your players scores.
Python
12
star
74

cmail

cmail runs a command and sends the output to your email address at certain intervals.
Go
12
star
75

gohead

An xrandr wrapper script to manage multi-monitor configurations. With hooks.
Go
12
star
76

burntsushi-blog

A small Go application for my old blog.
CSS
12
star
77

intern

A simple package for interning strings, with a focus on efficiently representing dense pairwise data.
Go
11
star
78

crev-proofs

My crev reviews.
10
star
79

pytyle1

A lightweight X11 tool for simulating tiling in a stacking window manager.
Python
9
star
80

cif

A golang package for reading and writing data in the Crystallographic Information File (CIF) format. It mostly conforms to the CIF 1.1 specification.
Go
9
star
81

rucd

WIP
Rust
8
star
82

qcsv

An API to read and analyze CSV files by inferring types for each column of data.
Python
8
star
83

pyndow

A window manager written in Python
Python
8
star
84

csql

Package csql provides convenience functions for use with the types and functions defined in the standard library `database/sql` package.
Go
6
star
85

freetype-go

A fork of freetype-go with bounding box calculations.
Go
6
star
86

sqlsess

Simple database backed session management. Integrates with Gorilla's sessions package.
Go
6
star
87

go-wayland-simple-shm

C
5
star
88

sqlauth

A simple Golang package that provides database backed user authentication with bcrypt.
Vim Script
4
star
89

lcmweb

A Go web application for coding documents with the Linguistic Category Model.
JavaScript
4
star
90

bcbgo

Computational biology tools for the BCB group at Tufts University.
Go
4
star
91

fex

A framework for specifying and executing experiments.
Haskell
3
star
92

present

My presentations.
HTML
3
star
93

memchr-2.6-mov-regression

Rust
3
star
94

genecentric

A tool to generate between-pathway modules and perform GO enrichment on them.
Python
3
star
95

rust-docs

A silly repo for managing my Rust crate documentation.
Python
3
star
96

pcre2-mirror

A git mirror for PCRE2's SVN repository at svn://vcs.exim.org/pcre2/code
2
star
97

xpyb

A clone of xorg-xpyb.
C
2
star
98

burntsushi-homepage

A small PHP web application for my old homepage.
PHP
2
star
99

window-marker

Use vim-like marks on windows.
Python
2
star
100

sudoku

An attempt at a sudoku solver in Haskell.
Haskell
1
star