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. --- lib/ui/ui.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/ui/ui.go') diff --git a/lib/ui/ui.go b/lib/ui/ui.go index 13b640b..4c3dd34 100644 --- a/lib/ui/ui.go +++ b/lib/ui/ui.go @@ -19,7 +19,7 @@ type UI struct { } func Initialize(conf *config.AercConfig, - content DrawableInteractive) (*UI, error) { + content DrawableInteractiveBeeper) (*UI, error) { screen, err := tcell.NewScreen() if err != nil { @@ -57,6 +57,7 @@ func Initialize(conf *config.AercConfig, content.OnInvalidate(func(_ Drawable) { atomic.StoreInt32(&state.invalid, 1) }) + content.OnBeep(screen.Beep) content.Focus(true) return &state, nil -- cgit v1.2.3