Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import xchat
- __module_name__ = "ac100 flashlight"
- __module_version__ = "1.0"
- __module_description__ = ""
- hl_contexts = []
- def set_highlight(hl_type=1):
- sys_fs = open('/sys/class/leds/nvec-led/brightness','w')
- sys_fs.write(str(hl_type))
- sys_fs.close()
- def hl_hook(word, word_eol, userdata):
- set_highlight(1)
- context = xchat.get_context()
- if context not in hl_contents:
- hl_contents.append(xchat.get_context())
- return xchat.EAT_NONE
- def focus_hook(word, word_eol, userdata):
- context = xchat.get_context()
- if context in hl_contexts:
- hl_contexts.remove(context)
- if not len(hl_contexts):
- set_highlight(0)
- return xchat.EAT_NONE
- #xchat.hook_print("Channel Msg Hilight", hl_hook)
- xchat.hook_print("Focus Tab", focus_hook)
- xchat.hook_print("Channel Action Hilight", hl_hook)
- xchat.hook_print("Channel Msg Hilight", hl_hook)
Advertisement
Add Comment
Please, Sign In to add comment