-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automatically toggle notifications for the current buffer when WeeChat looses or gains focus #6
Comments
Hi, the notification plugin does not care whether WeeChat has focus or not. Frankly, I don't even know how I would detect this :). So, notifications should be sent even when WeeChat doesn't have focus. Can you tell me the following?
I will then try to reproduce the issue. |
Hi, My setup:
The plugin configuration is:
|
Unfortunately, I am unable to reproduce the issue. This is what I tried:
Can you please verify that the above process really gives you no notification? When WeeChat has focus, you receive the notification? |
What I do not do is:
- Changed the current buffer to the WeeChat's main buffer (because of
python.notify_send.notify_for_current_buffer)
I just switch app vis alt-tab
On Mon, 13 Mar 2017 at 19:33, Petr Zemek ***@***.***> wrote:
Unfortunately, I am unable to reproduce the issue. This is what I tried:
- Installed Fedora 25 64b into a virtual machine (VirtualBox).
- Installed required WeeChat dependencies
<https://weechat.org/files/doc/stable/weechat_user.en.html#dependencies>
.
- Downloaded WeeChat 1.7
<https://weechat.org/files/src/weechat-1.7.tar.gz>, built it from
source, and installed.
- Downloaded and installed the plugin.
- Run WeeChat from terminal, set
python.notify_send.notify_for_current_buffer to off.
- Connected to IRC and started a private conversion (/query other_user
).
- Changed the current buffer to the WeeChat's main buffer (because of
python.notify_send.notify_for_current_buffer).
- Opened Firefox.
- In another WeeChat client, sent a message in the opened query.
- In Fedora, I received a notification for the message, even when the
currently opened window was Firefox.
Can you please verify that the above process really gives you no
notification? When WeeChat has focus, you receive the notification?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#6 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AByEhb1YObkLIna2PGJKpeceMggmriy0ks5rlYvrgaJpZM4MbP9b>
.
--
--
Luca Burgazzoli
|
I think there might be a misunderstanding about what the Can you turn the option back |
Yeah in that case it works, but would be lovely to take app focus into account :) |
I see. I will mark this issue as a feature request then. Unfortunately, I have no idea how to check whether WeeChat has focus or not. This a common problem shared by terminal applications. On WeeChat's FAQ, there is a question and answer related to this, but without a portable solution. So, I am afraid that there is nothing I can do right now. We will have to wait until there is a way of checking whether WeeChat has focus or not. |
no worries :) |
Hey guys, there is actually a pretty standard way to achieve this today. You can you "xterm focus events" to execute commands in weechat when it gains and loses focus, see here for an example. So what you need to do is the following:
Now enable the support for focus-events:
And configure this plugin to disable and enable notifications on focus gained and focus lost events:
Or for a complete toggle:
|
From that page:
|
Additionally, it seems that this should be added to the README - although note that @maximbaz got the option names in the key bindings incorrect; they should be:
|
I will happily take a PR for that. |
Turns out their docs are on Github, so I fixed them. Now you can trust the docs again 😉 Thanks for catching the typos 👍 |
@s3rvac You changed the title to:
This is the opposite of the goal(s) described in the comments here, which is to enable/"turn on" notifications when Weechat loses focus, and disable them when it gains focus - that way you aren't notified when you are currently using Weechat. Instead, I think this title would be slightly clearer:
|
@sudoforge You are right. I have corrected the title to the one that you suggested. |
I've been testing the above stated configuration (through regular usage) over the past few days. I'll submit a PR for the change to the README when I am confident that the solution works without any additional configuration needed -- I initially ran into a bug in which the binding for |
An update on this: It seems to work fine, save for one minor sometimes-inconvenient action of the keybindings being printed if the window is in a context that doesn't process the keybindings. As an example, with the above settings, if Weechat is loaded and you are prompted for your secure db's passphrase, triggering the focus event (by changing windows, or creating a new tmux pane) will cause characters to be printed to the passphrase input field, causing users to have to manually delete them before entering their password. |
Hello,
I'm unable to find a way to get a notification when a message is received on a buffer (or weechat itself) has lost focus i.e. I'm writing on on a buffer then I open the browser so weechat is now hidded behind the browser and I do not receive any notification of messages received on the buffer I was on: is there any configuration to do to achieve so ?
Thx
The text was updated successfully, but these errors were encountered: