Created
March 4, 2012 14:25
-
-
Save kanru/1973215 to your computer and use it in GitHub Desktop.
On Screen Display pluign of WeeChat
This file contains 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
# -*- coding: utf-8 -*- | |
# | |
# Kan-Ru Chen <[email protected]> | |
# License: GPLv3 | |
# | |
''' | |
On Screen Display pluign of WeeChat | |
''' | |
from os import popen | |
import weechat as w | |
SCRIPT_NAME = "osd" | |
SCRIPT_AUTHOR = "Kan-Ru Chen <[email protected]>" | |
SCRIPT_VERSION = "0.1" | |
SCRIPT_LICENSE = "GPLv3" | |
SCRIPT_DESC = "On Screen Display plugin of WeeChat" | |
pipe = None | |
def print_cb(data, buffer, date, tags, displayed, highlight, prefix, message): | |
pipe.write(prefix + ": " + message + "\n") | |
pipe.flush() | |
return w.WEECHAT_RC_OK | |
if w.register(SCRIPT_NAME, SCRIPT_AUTHOR, SCRIPT_VERSION, SCRIPT_LICENSE, | |
SCRIPT_DESC, '', ''): | |
pipe = popen("aosd_cat -n 'Sans 20' -B block -b 70", "w") | |
w.hook_print("", "irc_privmsg", "", 1, "print_cb", "") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment