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__ = ""
- fl_contexts = []
- def set_flashlight(hl_type=1):
- sys_fs = open('/sys/class/leds/nvec-led/brightness','w')
- sys_fs.write(str(hl_type))
- sys_fs.close()
- def fl_hook(word, word_eol, userdata):
- set_flashlight(1)
- global fl_contexts
- context = xchat.get_context()
- if context not in fl_contexts:
- fl_contexts.append(xchat.get_context())
- return xchat.EAT_NONE
- def focus_hook(word, word_eol, userdata):
- context = xchat.get_context()
- global fl_contexts
- if context in fl_contexts:
- fl_contexts.remove(context)
- if not len(fl_contexts):
- set_flashlight(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", fl_hook)
- xchat.hook_print("Channel Msg Hilight", fl_hook)
Advertisement
Add Comment
Please, Sign In to add comment