From 152f8c9519ac1b7b35c3789b03f3d1cc3b1e8881 Mon Sep 17 00:00:00 2001 From: Ben Burwell Date: Mon, 29 Jul 2019 10:50:02 -0400 Subject: Ring bell when new messages arrive Add a "new-message-bell" option to the UI section of aerc.conf. A new hook into the message store allows the msglist widget to detect new messages being added to the displayed list. When new messages are delivered, and the new-message-bell option is enabled (as it is by default), the terminal will beep. --- widgets/account.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'widgets/account.go') diff --git a/widgets/account.go b/widgets/account.go index 86ec00c..de81ab8 100644 --- a/widgets/account.go +++ b/widgets/account.go @@ -205,6 +205,10 @@ func (acct *AccountView) onMessage(msg types.WorkerMessage) { func(msg *models.MessageInfo) { acct.conf.Triggers.ExecNewEmail(acct.acct, acct.conf, msg) + }, func() { + if acct.conf.Ui.NewMessageBell { + acct.host.Beep() + } }) acct.dirlist.SetMsgStore(msg.Info.Name, store) store.OnUpdate(func(_ *lib.MessageStore) { -- cgit v1.2.3