From: Yvain THONNART <[email protected]>
Date: Mon, 17 Jul 2017 15:59:32 +0200
Subject: [PATCH] alerts: activity/silence bell in current window
Bell can be used as an urgency hint.
Excluding current window is fine when the actual terminal running tmux is
in the foreground e.g. in a X session, but actually hides the upstream
notification to terminal and window-manager.
This modification triggers a bell event (if bell-on-alert is on) even in
the current window, and even if the session has already been alerted,
i.e at all occurences of the activity/silence monitor.
---
alerts.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/alerts.c b/alerts.c
index a489d44..b981933 100644
--- a/alerts.c
+++ b/alerts.c
@@ -237,6 +237,8 @@ alerts_check_activity(struct window *w)
if (wl->flags & WINLINK_ACTIVITY)
continue;
s = wl->session;
+ if (options_get_number(s->options, "bell-on-alert"))
+ alerts_ring_bell(s);
if (s->curw == wl)
continue;
@@ -247,8 +249,6 @@ alerts_check_activity(struct window *w)
continue;
s->flags |= SESSION_ALERTED;
- if (options_get_number(s->options, "bell-on-alert"))
- alerts_ring_bell(s);
if (options_get_number(s->options, "visual-activity"))
alerts_set_message(s, "Activity in window %d",
wl->idx);
}
@@ -274,6 +274,8 @@ alerts_check_silence(struct window *w)
if (wl->flags & WINLINK_SILENCE)
continue;
s = wl->session;
+ if (options_get_number(s->options, "bell-on-alert"))
+ alerts_ring_bell(s);
if (s->curw == wl)
continue;
wl->flags |= WINLINK_SILENCE;
@@ -283,8 +285,6 @@ alerts_check_silence(struct window *w)
continue;
s->flags |= SESSION_ALERTED;
- if (options_get_number(s->options, "bell-on-alert"))
- alerts_ring_bell(s);
if (options_get_number(s->options, "visual-silence"))
alerts_set_message(s, "Silence in window %d",
wl->idx);
}
--
2.7.0.25.gfc10eb5
2017-07-17 19:53 GMT+02:00 Yvain Thonnart <[email protected]>:
> Dear tmux maintainers,
>
> First of all, many thanks for your impressive continued work on this great
> program.
>
> I stumbled upon an issue with activity monitoring in trying to setup a new
> workflow.
>
> I am using the bell as an urgency hint in most of my console programs, to
> notify my terminal and windowmanager (namely xterm and i3wm) of important
> notices. I have been using it with tmux to pass on a bell signal for a long
> time.
> Yet, as I recently tried to use activity monitoring, I found out that the
> alert is sent only when the alterting window is not the current window.
> However, as I am using several terminals and workspaces, the current window
> is not always visible, so I needed to create a dummy window to switch to in
> order to get the notification from the real window.
>
> I tried to play a bit with the options, and even with the hooks in the
> latest versions, with no success.
> Diggig in the code, I saw that you filter the alerts from the current
> window.
>
> I propose you a little modification, which actually suits my needs, where
> the bell is passed even in current window.
>
> Apparently your integration strategy is via email patches, so I will post
> it as a followup.
>
> I will be happy to discuss this, whether you think it is relevant or not,
> or if I missed a simple configuration setup...
>
> Best regards,
>
> Yvain Thonnart
>
> --------------------
>
> Yvain THONNART (1):
> alerts: activity/silence bell in current window
>
> alerts.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
--
You received this message because you are subscribed to the Google Groups
"tmux-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.