aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2023-12-09 21:57:56 +0100
committerTeddy Wing2023-12-09 21:57:56 +0100
commit79ab49de58bdbd6ad8513e903fe82143174b328d (patch)
treefe2adf8cf51e35032f91c559c58b2ee264a72552
parent2e5206eb038f61fb8fa5e76a73bc986696ad9fa1 (diff)
downloadweechat-activity-bar-79ab49de58bdbd6ad8513e903fe82143174b328d.tar.bz2
activity_bar.pl: Add `/activity_bar clear` command
Command to clear the activity notification colour from AnyBar and turn it hollow.
-rw-r--r--activity_bar.pl17
1 files changed, 17 insertions, 0 deletions
diff --git a/activity_bar.pl b/activity_bar.pl
index e76486b..b9bf4d7 100644
--- a/activity_bar.pl
+++ b/activity_bar.pl
@@ -28,6 +28,15 @@ sub shutdown {
weechat::hook_print('', '', '', 0, 'print_cb', '');
+weechat::hook_command(
+ 'activity_bar',
+ 'Activity Bar commands',
+ '[clear]',
+ 'clear: change AnyBar icon to hollow',
+ 'clear',
+ 'activity_bar_command_cb',
+ ''
+);
sub print_cb {
my ($data, $buffer, $date, $tags, $displayed, $highlight, $prefix, $message) = @_;
@@ -52,3 +61,11 @@ sub anybar_send {
$socket->send($message);
}
+
+sub activity_bar_command_cb {
+ my ($data, $buffer, $args) = @_;
+
+ anybar_send('hollow');
+
+ return weechat::WEECHAT_RC_OK;
+}