func SubNodeByName(node *i3ipc.I3Node, name string) (root i3ipc.I3Node, err error) {
	if strings.Compare(node.Name, name) == 0 {
		return *node, nil
	}
	for _, arm := range node.Nodes {
		res, err := SubNodeByName(&arm, name)
		if err == nil {
			return res, err
		}
	}
	return i3ipc.I3Node{}, errors.New("no such Node")
}
SubNodeByName gets the subnode of an I3Node by name
package main
import (
	"errors"
	"flag"
	"fmt"
	"io/ioutil"
	"log"
	"os"
	"os/user"
	"strings"
	"github.com/nwhirschfeld/i3ipc"
)
func main() {
	usr, err := user.Current()
    if err != nil {
        log.Fatal( err )
    }
	var configFileName = flag.String("c", usr.HomeDir + "/.config/i3icons/i3icons2.config", "config file")
	var verbose = flag.Bool("v", false, "verbose")
	flag.Parse()
	configFile, err := os.Open(*configFileName)
	if err != nil {
		fmt.Println(err)
		flag.Usage()
		os.Exit(1)
	}
	defer configFile.Close()
	byteValue, _ := ioutil.ReadAll(configFile)
	configLines := strings.Split(string(byteValue), "\n")
	config := make(map[string]string)
	for _, ci := range configLines {
		p := strings.Split(string(ci), "=")
		if len(p) == 2 {
			config[p[0]] = p[1]
		}
	}
	ipcsocket, _ := i3ipc.GetIPCSocket()
	channel, err := i3ipc.Subscribe(i3ipc.I3WindowEvent)
	EventLoop(channel, ipcsocket, config, *verbose)
}