summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go15
1 files changed, 8 insertions, 7 deletions
diff --git a/main.go b/main.go
index d8866b8..cac7c6c 100644
--- a/main.go
+++ b/main.go
@@ -32,8 +32,9 @@ func main() {
}
defer bspc.Cleanup()
- bar.NewState <- bspc.Handle.State
- for _, m := range bspc.Handle.State.Monitors {
+ state := <- bspc.NewState
+ bar.NewState <- state
+ for _, m := range state.Monitors {
bar.Create <- m.ID
}
@@ -45,10 +46,10 @@ func main() {
case err := <-bar.Err:
common.Error("%s\n", err)
return
- case err := <-bspc.Handle.EvErr:
+ case err := <-bspc.EvErr:
common.Error("Couldn't read event: %s\n", err)
return
- case event := <-bspc.Handle.Event:
+ case event := <-bspc.Event:
if strings.HasPrefix(event.Name, "monitor_") {
id, err := common.Intify(event.Tokens[0])
if err == nil {
@@ -61,11 +62,11 @@ func main() {
}
}
}
- case err := <-bspc.Handle.StErr:
+ case err := <-bspc.StErr:
common.Error("Couldn't load bspwm state: %s\n", err)
return
- case <-bspc.Handle.StateUpdate:
- bar.NewState <- bspc.Handle.State
+ case s := <-bspc.NewState:
+ bar.NewState <- s
}
}
}