Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

init

  • Loading branch information...
commit 9d68c92baf2fec73f43ed61407bbf4c616b2dd50 0 parents
@sindresorhus authored
9 .editorconfig
@@ -0,0 +1,9 @@
+# editorconfig.org
+root = true
+
+[*]
+indent_style = tab
+end_of_line = lf
+charset = utf-8
+trim_trailing_whitespace = true
+insert_final_newline = true
1  .gitattributes
@@ -0,0 +1 @@
+* text=auto
33 notification_center.py
@@ -0,0 +1,33 @@
+# https://github.com/sindresorhus/weechat-notification-center
+# Requires `pip install pync`
+
+import weechat
+from pync import Notifier
+
+
+SCRIPT_NAME = 'notification_center'
+SCRIPT_AUTHOR = 'Sindre Sorhus <sindresorhus@gmail.com>'
+SCRIPT_VERSION = '0.1'
+SCRIPT_LICENSE = 'MIT'
+SCRIPT_DESC = 'Pass highlights and private messages to the OS X 10.8+ Notification Center'
+
+weechat.register(SCRIPT_NAME, SCRIPT_AUTHOR, SCRIPT_VERSION, SCRIPT_LICENSE, SCRIPT_DESC, '', '')
+
+DEFAULT_OPTIONS = {
+ 'show_highlights': 'on',
+ 'show_private_message': 'on',
+}
+
+for key, val in DEFAULT_OPTIONS.items():
+ if not weechat.config_is_set_plugin(key):
+ weechat.config_set_plugin(key, val)
+
+weechat.hook_print('', 'irc_privmsg', '', 1, 'notify', '')
+
+def notify(data, buffer, date, tags, displayed, highlight, prefix, message):
+ if weechat.config_get_plugin('show_highlights') == 'on' and highlight == '1':
+ channel = weechat.buffer_get_string(buffer, 'localvar_channel')
+ Notifier.notify(message, title='%s %s' % (prefix, channel))
+ elif weechat.config_get_plugin('show_private_message') == 'on' and 'notify_private' in tags:
+ Notifier.notify(message, title='%s [private]' % prefix)
+ return weechat.WEECHAT_RC_OK
17 readme.md
@@ -0,0 +1,17 @@
+# WeeChat Notification Center
+
+![screenshot](https://raw.github.com/sindresorhus/weechat-notification-center/master/screenshot.png)
+
+[WeeChat](http://www.weechat.org) script to pass highlights and private messages to the OS X 10.8+ Notification Center
+
+
+## Getting Started
+
+- Install [pync](https://github.com/SeTeM/pync): `pip install pync`
+- Put `notification_center.py` in `~/.weechat/python/autoload/`
+
+
+## License
+
+MIT License
+(c) [Sindre Sorhus](http://sindresorhus.com)
BIN  screenshot.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Please sign in to comment.
Something went wrong with that request. Please try again.