about summary refs log tree commit diff stats
path: root/aerc.go
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2019-07-19 14:15:48 -0400
committerDrew DeVault <sir@cmpwn.com>2019-07-19 14:15:48 -0400
commit7a489cb0011a34a68d3e77d0174076857cc37902 (patch)
treed21df8ea9b872ccc08cff117f203ad0d80b94a26 /aerc.go
parentb3a66866b95d77f202f571efedd2f7ec309aacf5 (diff)
downloadaerc-7a489cb0011a34a68d3e77d0174076857cc37902.tar.gz
Add Unix socket for communicating with aerc
Diffstat (limited to 'aerc.go')
-rw-r--r--aerc.go10
1 files changed, 10 insertions, 0 deletions
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