weechat-notify-send icon indicating copy to clipboard operation
weechat-notify-send copied to clipboard

Add command to query/add/remove current buffer from config

Open mildred opened this issue 8 years ago • 3 comments

There are two configuration options that can hold buffers:

  • notify_on_all_messages_in_buffers
  • ignore_buffers

It would be great to have a command to add / remove the current buffer from these lists, or query it. I was thinking of something like:

/notifybuf list
/notifybuf add [BUFFER]
/notifybuf del [BUFFER]
/mute list
/mute add [BUFFER]
/mute del [BUFFER]

Could you think of better command names?

What do you think ? Would a PR like this accepted ? Thank you.

mildred avatar Nov 10 '16 22:11 mildred

Thank you for your interest in the plugin and the idea of adding commands to it. Currently, I am not sure whether adding these commands would benefit the plugin, for the following reasons:

  • There is already a way of doing this: changing configuration options. With e.g. iset.pl, it is a piece of cake. Adding commands to do this would bring us a second, duplicate way. Moreover, there would be more code to maintain.
  • There are many other options, e.g. ignore_nicks, ignore_buffers_starting_with, ignore_messages_tagged_with. When adding commands for some of them, it would make sense to add commands for all of them. We would need a good, consistent schema for naming such commands. Also, this would result in creation of many commands.
  • I am not sure whether we could come up with names that would be unique (so they do not conflict with other commands) and descriptive (so they do exactly what they they appear to be doing). For example, the /mute command could as well mean that no messages should printed in the given buffers.

Nevertheless, I will leave the issue open so others can present their opinion as well.

s3rvac avatar Nov 13 '16 10:11 s3rvac

Well, the main idea behind this is to make it easy to see and change the configuration. Both are difficult for the moment (have to remember the setting name).

Another idea to make it easy to know the configuration of channels would be to integrate with buffers.pl and show an icon next to each buffer.

mildred avatar Nov 14 '16 08:11 mildred

I'm a little late to the party, but I figured I'd chime in. Weechat allows you to create an alias (or alternatively, a key binding) to set the value of options. For example, to create an alias /watch to notify on all messages in the current buffer, issue the command:

/alias add watch /eval /set plugins.var.python.notify_send.notify_on_all_messages_in_buffers ${window.buffer.name}

Additionally, you can enclose the /eval in a /mute to execute the command silently (i.e., no output in the weechat core buffer):

/alias add watch /mute /eval /set plugins.var.python.notify_send.notify_on_all_messages_in_buffers ${window.buffer.name}

Note that this command blindly overwrites the value of notify_on_all_messages_in_buffers with the current buffer name, so it's not really a helpful if you want to add multiple buffer names to notify_on_all_messages_in_buffers as a comma-separated list.

I am using weechat version 3.1.

ntwk avatar Jul 08 '21 12:07 ntwk