weechat- me personal weechat setup 🔵🟢 |
git clone git://git.acid.vegas/weechat.git |
Log | Files | Refs | Archive | README |
rainbow.py (765B)
1 # -*- coding: utf-8 -*- 2 # rainbow script for weechat - developed by acidvegas in python (https://git.acid.vegas/weechat) 3 4 import weechat 5 6 def cmd_rainbow(data, buf, args): 7 colors = [5,4,7,8,3,9,10,11,2,12,6,13] 8 output = '' 9 if args[:2] == '-w': 10 for word in args[2:].split(): 11 output += '\x03' + str(colors[0]) + word + ' ' 12 colors.append(colors.pop(0)) 13 else: 14 for char in list(args): 15 if char == ' ': 16 output += char 17 else: 18 output += '\x03' + str(colors[0]) + char 19 colors.append(colors.pop(0)) 20 weechat.command(buf, '/input send ' + output) 21 return weechat.WEECHAT_RC_OK 22 23 if weechat.register('rainbow', 'acidvegas', '1.0', 'ISC', 'rainbow text', '', ''): 24 weechat.hook_command('rainbow', 'rainbow text', '<text>', '', '', 'cmd_rainbow', '')