summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-01-10 22:03:56 -0500
committerDrew DeVault <sir@cmpwn.com>2018-01-10 22:03:56 -0500
commitdb1b2cd53f5dc7bfbfb6ee54ad0bb0882ea2cc03 (patch)
tree97c17d675dc2b38cf2acb6473f545de2c0d42979 /cmd
parenta0be5e80256b98237241b2f3d7825484e7a9c964 (diff)
downloadaerc-db1b2cd53f5dc7bfbfb6ee54ad0bb0882ea2cc03.zip
Renderer scaffolding
Diffstat (limited to 'cmd')
-rw-r--r--cmd/aerc/main.go12
1 files changed, 8 insertions, 4 deletions
diff --git a/cmd/aerc/main.go b/cmd/aerc/main.go
index 9188dce..4adf11e 100644
--- a/cmd/aerc/main.go
+++ b/cmd/aerc/main.go
@@ -1,10 +1,10 @@
package main
import (
- "fmt"
"time"
"git.sr.ht/~sircmpwn/aerc2/config"
+ "git.sr.ht/~sircmpwn/aerc2/ui"
"git.sr.ht/~sircmpwn/aerc2/worker"
"git.sr.ht/~sircmpwn/aerc2/worker/types"
)
@@ -20,19 +20,23 @@ func main() {
if err != nil {
panic(err)
}
- fmt.Printf("Initializing worker %s\n", account.Name)
go work.Run()
work.PostAction(types.Configure{Config: account})
workers = append(workers, work)
}
- for {
+ _ui, err := ui.Initialize(conf)
+ if err != nil {
+ panic(err)
+ }
+ defer _ui.Close()
+ for !_ui.Exit {
activity := false
for _, worker := range workers {
if msg := worker.GetMessage(); msg != nil {
activity = true
- fmt.Printf("<- %T\n", msg)
}
}
+ activity = _ui.Tick() || activity
if !activity {
time.Sleep(100 * time.Millisecond)
}