Skip to content

Instantly share code, notes, and snippets.

@kanru
Created March 4, 2012 14:25
Show Gist options
  • Save kanru/1973215 to your computer and use it in GitHub Desktop.
Save kanru/1973215 to your computer and use it in GitHub Desktop.
On Screen Display pluign of WeeChat
# -*- 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