weechat

- me personal weechat setup 🔵🟢
git clone git://git.acid.vegas/weechat.git
Log | Files | Refs | Archive | README

fullwidth.py (658B)

      1 # -*- coding: utf-8 -*-
      2 # fullwidth script for weechat - developed by acidvegas in python (https://git.acid.vegas/weechat)
      3 
      4 import weechat
      5 
      6 def cmd_fullwidth(data, buf, args):
      7 	chars = list()
      8 	for char in list(args):
      9 		if ord(char) == 32:
     10 			char = chr(12288)
     11 		elif ord(char) > 32 and ord(char) <= 126:
     12 			char = chr(ord(char) + 65248)
     13 		chars.append(char)
     14 	weechat.command(buf, '/input send ' + ''.join(chars))
     15 	return weechat.WEECHAT_RC_OK
     16 
     17 if weechat.register('fullwidth', 'acidvegas', '1.0', 'ISC', 'convert text to wide characters.', '', ''):
     18 	weechat.hook_command('fullwidth', 'convert text to wide characters.', '<text>', '', '', 'cmd_fullwidth', '')