Skip to content
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

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

Open
mildred opened this issue Nov 10, 2016 · 3 comments
Open

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

mildred opened this issue Nov 10, 2016 · 3 comments

Comments

@mildred
Copy link

mildred commented Nov 10, 2016

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.

@s3rvac
Copy link
Owner

s3rvac commented Nov 13, 2016

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.

@mildred
Copy link
Author

mildred commented Nov 14, 2016

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.

@ntwk
Copy link

ntwk commented Jul 8, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants