notify ( 'From %s ' % prefix, title = 'Private Message', sound = sound, appIcon = WEECHAT_ICON, activate = activate_bundle_id ) return weechat. notify ( message, title = ' %s ' % prefix, sound = sound, appIcon = WEECHAT_ICON, activate = activate_bundle_id ) else : Notifier. config_get_plugin ( 'show_message_text' ) = 'on' : Notifier. config_get_plugin ( 'show_private_message' ) = 'on' and 'irc_privmsg' in tags and 'notify_private' in tags : if weechat. notify ( 'In %s by %s ' % ( channel, prefix ), title = 'Highlighted Message', sound = sound, appIcon = WEECHAT_ICON, activate = activate_bundle_id ) elif weechat. notify ( message, title = ' %s %s ' % ( prefix, channel ), sound = sound, appIcon = WEECHAT_ICON, activate = activate_bundle_id ) else : Notifier. config_get_plugin ( 'show_highlights' ) = 'on' and int ( highlight ): if weechat. notify ( 'In %s by %s ' % ( channel, prefix ), title = 'Channel Activity', sound = sound, appIcon = WEECHAT_ICON, activate = activate_bundle_id ) elif weechat. buffer_get_string ( buffer, 'localvar_channel' ) if channel in channel_allow_list : if weechat. config_get_plugin ( 'channels' ) != "" : channel_allow_list = weechat. config_get_plugin ( 'activate_bundle_id' ) channel_allow_list = if weechat. config_get_plugin ( 'sound' ) = 'on' else lambda : _ activate_bundle_id = weechat. config_get_plugin ( 'sound_name' ) if weechat. WEECHAT_RC_OK # Passing `None` or `''` still plays the default sound so we pass a lambda instead sound = weechat. utcnow () # Ignore if the message is greater than 5 seconds old if ( now_time - message_time ). utcfromtimestamp ( int ( date )) now_time = datetime. config_get_plugin ( 'ignore_old_messages' ) = 'on' : message_time = datetime. WEECHAT_RC_OK # Ignore messages older than the configured theshold (such as ZNC logs) if enabled if weechat. config_get_plugin ( 'ignore_current_buffer_messages' ) = 'on' and buffer = weechat. WEECHAT_RC_OK # Ignore messages from the current buffer if weechat. buffer_get_string ( buffer, 'localvar_nick' ) if prefix = own_nick or prefix = ( %s ' % own_nick ): return weechat. config_get_plugin ( 'tags' ), '', 1, 'notify', '' ) def notify ( data, buffer, date, tags, displayed, highlight, prefix, message ): # Ignore if it's yourself own_nick = weechat. hook_print ( '', 'irc_privmsg,' + weechat. info_get ( 'weechat_dir', '' ), 'weechat.png' ) DEFAULT_OPTIONS = for key, val in DEFAULT_OPTIONS. WeeChat developers are NOT RESPONSIBLE for problems caused by one of these scripts: you could experience problems like memory leaks, slowdowns, or even. info_get ( 'weechat_config_dir', '' ), 'weechat.png' ) else : WEECHAT_ICON = os. WeeChat official scripts This page shows a collection of WeeChat scripts written by external contributors, which can be installed directly in WeeChat with the command /script install .info_get ( 'version_number', '' ) or 0 if int ( WEECHAT_VERSION ) >= 0x03020000 : WEECHAT_ICON = os. register ( SCRIPT_NAME, SCRIPT_AUTHOR, SCRIPT_VERSION, SCRIPT_LICENSE, SCRIPT_DESC, '', '' ) WEECHAT_VERSION = weechat. This can be used in combination with _tags to generate custom notifications.# Requires `pip install pync` import os import datetime import weechat from pync import Notifier SCRIPT_NAME = 'notification_center' SCRIPT_AUTHOR = 'Sindre Sorhus ' SCRIPT_VERSION = '1.5.2' SCRIPT_LICENSE = 'MIT' SCRIPT_DESC = 'Pass highlights and private messages to the macOS Notification Center' weechat. tagsĪdditional message tags that can trigger notifications. Values: Comma-separated list of channel namesĬhannels in this list will trigger a notification on every message received. This is especially useful if you use wee-slack and receive notifications for messages they send, as discussed in #22. ignore_current_buffer_messagesÄetermines whether messages from the current buffer should trigger notifications or not. ignore_old_messagesÄetermines whether old messages, such as log playbacks, will trigger notifications or not. The app bundle ID can be found in /Applications/.app/Contents/ist, right below the CFBundleIdentifier key. Values: '' '2' (or any bundle ID that your terminal uses)Īpp to activate when the notification is clicked. Values: 'Basso' 'Blow' 'Bottle' 'Frog' 'Funk' 'Glass' 'Hero' 'Morse' 'Ping' 'Pop' 'Purr' 'Sosumi' 'Submarine' 'Tink', but can really be anything that has an aptly named sound file in /System/Library/Sounds/, /Library/Sounds/, or ~/Library/Sounds/. Copy or symlink notification_center.py into ~/.weechat/python/autoload/.Copy or symlink weechat.png to ~/.weechat/weechat.png.Find notification_center and type i then Enter to install.In WeeChat, type /script to open the script manager.Copy weechat.png from this repository to ~/.weechat/weechat.png.WeeChat script to pass highlights and private messages to the macOS Notification Center Install Script center
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |