Created
November 23, 2020 12:13
-
-
Save gryf/2ff99edd3662e5fbcc92d260b5135a4e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import subprocess | |
| import weechat | |
| info = ('notify', | |
| 'gryf', | |
| '0.1', | |
| 'GPL3', | |
| "Use desktop notify for highlighted & private IRC messages", | |
| '', | |
| '') | |
| def notify_send(data, signal, msgtxt, trial=1): | |
| if os.path.exists(os.path.expanduser("~/.dont_send_notify")): | |
| return weechat.WEECHAT_RC_OK | |
| who, msg = msgtxt.split('\t') | |
| subprocess.call(['notify-send', '--app-name', 'weechat', | |
| 'local IRC: ' + who, msg]) | |
| return weechat.WEECHAT_RC_OK | |
| if weechat.register(*info): | |
| weechat.hook_signal('weechat_highlight', 'notify_send', '') | |
| weechat.hook_signal('weechat_pv', 'notify_send', '') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment