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/interfaces.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib/ui/interfaces.go') diff --git a/lib/ui/interfaces.go b/lib/ui/interfaces.go index 9008ea72..2f634248 100644 --- a/lib/ui/interfaces.go +++ b/lib/ui/interfaces.go @@ -23,6 +23,10 @@ type Interactive interface { Focus(focus bool) } +type Beeper interface { + OnBeep(func() error) +} + type Simulator interface { // Queues up the given input events for simulation Simulate(events []tcell.Event) @@ -33,6 +37,11 @@ type DrawableInteractive interface { Interactive } +type DrawableInteractiveBeeper interface { + DrawableInteractive + Beeper +} + // A drawable which contains other drawables type Container interface { Drawable -- cgit