Prepping for first release; mostly documentation and CI changes.
6 files changed, 98 insertions(+), 41 deletions(-)

A => .build.yml
A => CHANGELOG.md
M README.md
M go.mod
M main.go
A => screenshot.png
A => .build.yml +19 -0
@@ 0,0 1,19 @@ 
+image: alpine/edge
+packages:
+  - go
+  - mercurial
+sources: 
+  - hg+https://hg.sr.ht/~ser/i3quake
+secrets:
+  - 9da08cd5-411e-41f6-80c9-2482104af158
+tasks:
+  - build: |
+      cd i3quake
+      VERSION=`hg log -r tip --template '{bookmarks}'`
+      BUILDDATE=`date +%Y-%m-%dT%H%M%S`
+      GOOS=linux go build -ldflags "-X main.Version=${VERSION} -X main.BuildDate=${BUILDDATE}" -v -o i3quake_${VERSION} .
+  - upload: |
+      cd i3quake
+      CRED=`cat ~/.credentials`
+      VERSION=`hg log -r tip --template '{bookmarks}'`
+      curl --netrc-file ~/.credentials -T i3quake_${VERSION} https://downloads.ser1.net/files/

          
A => CHANGELOG.md +18 -0
@@ 0,0 1,18 @@ 
+# Changelog
+All notable changes to this project will be documented in this file.
+
+The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
+and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+
+> **Types of changes**:
+>
+> - **Added**: for new features.
+> - **Changed**: for changes in existing functionality.
+> - **Deprecated**: for soon-to-be removed features.
+> - **Removed**: for now removed features.
+> - **Fixed**: for any bug fixes.
+> - **Security**: in case of vulnerabilities.
+
+## [1.0.0] - 2020-04-03
+
+First release.

          
M README.md +46 -36
@@ 1,61 1,71 @@ 
 # i3quake
 
-Quake mode for terminal in [i3](https://github.com/i3/i3) window manager
+Quake mode for terminals under the [i3](https://github.com/i3/i3) window manager.  It's a drop-in replacement for [i3-quake](https://github.com/NearHuscarl/i3-quake) -- I've kept the command line arguments cross-compatible.
+
+i3quake creates, shows, and hides a terminal of your choosing.  Common use for these sorts of tools is to bind a hotkey to the command and thereby create a pop-up-on-demand terminal. Features are:
 
-![quake](https://github.com/NearHuscarl/i3-quake/blob/master/screen/quake.png)
+* The terminal instance is persistent, which is a bit more lightweight than creating and destroying terminals; it also preserves your current workstream in that terminal.
+* Uses any terminal you choose.  It's been tested with alacritty, roxterm, xterm, gnome-terminal, xfce4-terminal, termite, and st.  st is the default.
+* Opens the terminal on any edge, with configurable size.
+* Written in Go, and there are no additional dependencies.
+* It's stateless. There's no server process.
+
+![i3quake](https://hg.sr.ht/~ser/i3quake/raw/default/screenshot.png)
 
 ## Installation
-* Install all dependencies
-* Download the python file and put it in `$PATH`
+
+The program is `go get`-table:
+
+```
+go get code.ser1.net/i3quake
+```
 
-## Usage
-Open terminal dropdown in quake style (or bottom up). Each workspace can
-have one terminal in quake mode. If the focused workspace already have
-quake terminal. The next command will toggle visiblity state of said
-console regardless of the input arguments
+Or, you can [download a binary](https://downloads.ser1.net/downloads).  Put the executable in your path, and then bind the program to a key chord in i3. For example:
+
+```
+bindsym $mod+n exec i3quake -p right -H 0.6 -t termite
+```
+
+Arguments are (currently) ignored after the first run.
+
 
 ## Options
 
 ```bash
-$ i3_quake -h
-usage: i3_quake [-h] [-i] [-p POS] [-H RATIO] [-t TERM] [CMD]
-
-positional arguments:
-  CMD                   command to execute in new terminal
-
-optional arguments:
-  -h, --help            show this help message and exit
-  -i, --in-place        set current terminal at top down position and execute
-                        cmd
-  -p POS, --pos POS     open terminal at top or bottom (default is top)
-  -H RATIO, --height RATIO
-                        height of terminal in percentage of monitor height
-  -t TERM, --term TERM  terminal name (default is xterm)
+➜  ~ i3quake -h
+Usage of i3quake:
+  -H float
+        % height of window, 0-1 (0.25) (default 0.25)
+  -p string
+        Position: top, bottom, left, right (top) (default "top")
+  -t string
+        Terminal program (default "st")
 ```
 
 ## Examples
 ```bash
-$ i3_quake # default use xterm and open $SHELL
+$ i3quake    # default use st and open $SHELL
 ```
 ```bash
-$ i3_quake -H 0.6 -t termite htop
+$ i3quake -H 0.5 -t termite
 ```
 ```bash
-$ i3_quake -p bottom -H 0.2 -t xfce4-terminal ipython
+$ i3quake -p right -H 0.6 -t xfce4-terminal
 ```
 
-## Flickering
-Add this line to i3 config (~/.config/i3/config) to hide the terminal
-immediately when created to prevent flickering issue
+## Why
+I first tried a couple of other projects, but they were all several years old. The one I liked the most had a couple of limitations, bugs, and were out of date with the i3 IPC API. The main bug was that it used the WM_NAME property to identify the quake window, and **everybody** changes that, so it's not reliable. At first I tried to fix the program -- it was only a few dozen lines of Python, after all -- but I encountered three roadblocks:
 
-```i3
-for_window [title="quake_.*"] move window to scratchpad
-```
+1. I don't know Python.  I don't *like* Python, but I also don't know it, so working on the application was unpleasant and difficult.
+2. There is little useful documentation deeper than surface level for the i3 IPC interface, and even less for the Python i3ipc interface.
+3. What stopped me in the end, though, was that to fix the WM_NAME bug, I needed to use the i3 mark feature.  However, you can't create a window and mark it at the same time, so you need to fork a process, wait for the window to appear, and *then* mark it.  This is when I discovered that writing concurrent code in Python is truly a new level of hell, and I threw in the towel.
+
+Both go-i3ipc libraries I found were also not current with the i3 IPC API, but this was easily addressed, and I spent about a quarter of the time rewriting i3quake from scratch in Go than I spent trying (unsuccessfully) to fix the Python version. This is not because it's faster to write Go; it's because it's faster for **me** to write Go, and because I'd already discovered all of the speed bumps in working on the Python version and knew how I wanted to approach the problem.  The parallel code was certainly nicer in Go.
 
 ## Credit
-Original work is [i3-quickterm](https://github.com/lbonn/i3-quickterm) by [ibonn](https://github.com/lbonn)
-which will open terminal dropdown from selected shell in rofi dmenu. i3-quake generalize the idea
-with command argument to run when open terminal.
+The Python version that I started with was [i3-quake](https://github.com/NearHuscarl/i3-quake). That, itself, was inspired by [i3-quickterm](https://github.com/lbonn/i3-quickterm). If we're going all the way back, the idea was popularized by the video game [Quake](https://en.wikipedia.org/wiki/Quake_%28video_game%29), by ID software.
+
+This version uses [i3ipc-go](https://github.com/xxxserxxx/i3ipc-go); it's the only third-party dependency, and it was forked off [ndemarinis's](https://github.com/ndemarinis/i3ipc-go) fork of mdirkse's original project. Both of those projects are a bit out of date and were missing support for i3's marking feature.
 
 ## Licenses
-**[BSD 3 Clauses](https://github.com/NearHuscarl/i3-quake/blob/master/LICENSE.md)**
+**[BSD 3 Clauses](https://hg.sr.ht/~ser/i3quake/LICENSE.txt)**

          
M go.mod +1 -1
@@ 1,4 1,4 @@ 
-module hg.sr.ht/~ser/i3quake
+module code.ser1.net/i3quake
 
 go 1.14
 

          
M main.go +14 -4
@@ 1,16 1,14 @@ 
 package main
 
-// TODO: arguments to the shell
-// TODO: vanity package
 // TODO: code cleanup
-// TODO: upload to repo
 // TODO: CI
-// TODO: documentation
+// TODO: AUR & download
 
 import (
 	"flag"
 	"fmt"
 	"log"
+	"os"
 	"os/exec"
 	"strings"
 	"sync"

          
@@ 18,6 16,8 @@ import (
 	"github.com/xxxserxxx/i3ipc-go"
 )
 
+var Version, BuildDate string
+
 const (
 	NAME = "i3quake"
 )

          
@@ 34,10 34,18 @@ type con struct {
 }
 
 func main() {
+	// TODO: Option to have per-workspace quake
 	pos := flag.String("p", "top", "Position: top, bottom, left, right (top)")
 	ratio := flag.Float64("H", 0.25, "% height of window, 0-1 (0.25)")
+	// TODO: allow arguments for terminal command
 	cmd := flag.String("t", "st", "Terminal program")
+	version := flag.Bool("v", false, "Print the version and exit")
+	// TODO: allow shell command as argument (e.g., tmux)
 	flag.Parse()
+	if *version {
+		fmt.Printf("i3quake version %s (built %s)", Version, BuildDate)
+		os.Exit(0)
+	}
 	var p int
 	switch strings.ToLower(*pos) {
 	default:

          
@@ 56,6 64,7 @@ func main() {
 		panic(e)
 	}
 	cx := con{c}
+	// TODO: i3-sensible-terminal if unset
 	cx.toggleQuake(p, *ratio, *cmd)
 }
 

          
@@ 105,6 114,7 @@ func (c con) toggleQuake(pos int, ratio 
 		com.Start()
 		w.Wait()
 	} else {
+		// TODO: Don't ignore argumentas after first run
 		cmd := fmt.Sprintf(`[con_mark="%s"], scratchpad show`, NAME)
 		suc, _ := c.Command(cmd)
 		if !suc {

          
A => screenshot.png +0 -0