From 7a489cb0011a34a68d3e77d0174076857cc37902 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Fri, 19 Jul 2019 14:15:48 -0400 Subject: Add Unix socket for communicating with aerc --- aerc.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'aerc.go') diff --git a/aerc.go b/aerc.go index 40e6605..d44d3ba 100644 --- a/aerc.go +++ b/aerc.go @@ -18,6 +18,7 @@ import ( "git.sr.ht/~sircmpwn/aerc/commands/msgview" "git.sr.ht/~sircmpwn/aerc/commands/terminal" "git.sr.ht/~sircmpwn/aerc/config" + "git.sr.ht/~sircmpwn/aerc/lib" libui "git.sr.ht/~sircmpwn/aerc/lib/ui" "git.sr.ht/~sircmpwn/aerc/widgets" ) @@ -149,6 +150,15 @@ func main() { } defer ui.Close() + logger.Println("Starting Unix server") + as, err := lib.StartServer(logger) + if err != nil { + logger.Printf("Failed to start Unix server: %v (non-fatal)", err) + } else { + defer as.Close() + as.OnMailto = aerc.Mailto + } + for !ui.ShouldExit() { for aerc.Tick() { // Continue updating our internal state -- cgit v1.2.3