Guest User

Untitled

a guest
Mar 22nd, 2012
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. import xchat
  2.  
  3. __module_name__ = "ac100 flashlight"
  4. __module_version__ = "1.0"
  5. __module_description__ = ""
  6.  
  7. hl_contexts = []
  8.  
  9. def set_highlight(hl_type=1):
  10. sys_fs = open('/sys/class/leds/nvec-led/brightness','w')
  11. sys_fs.write(str(hl_type))
  12. sys_fs.close()
  13.  
  14. def hl_hook(word, word_eol, userdata):
  15. set_highlight(1)
  16. context = xchat.get_context()
  17. if context not in hl_contents:
  18. hl_contents.append(xchat.get_context())
  19. return xchat.EAT_NONE
  20.  
  21. def focus_hook(word, word_eol, userdata):
  22. context = xchat.get_context()
  23. if context in hl_contexts:
  24. hl_contexts.remove(context)
  25. if not len(hl_contexts):
  26. set_highlight(0)
  27. return xchat.EAT_NONE
  28.  
  29. #xchat.hook_print("Channel Msg Hilight", hl_hook)
  30. xchat.hook_print("Focus Tab", focus_hook)
  31. xchat.hook_print("Channel Action Hilight", hl_hook)
  32. xchat.hook_print("Channel Msg Hilight", hl_hook)
Advertisement
Add Comment
Please, Sign In to add comment