示例#1
0
def rooms_create_buffer(bitlbee_server):
    global rooms_buffer, rooms_curline

    if not rooms_buffer:
        rooms_buffer = weechat.buffer_new("hipchat_rooms", "rooms_input_cb",
                                          "", "rooms_close_cb", "")
        rooms_set_buffer_title()
        # Sets notify to 0 as this buffer does not need to be in hotlist.
        weechat.buffer_set(rooms_buffer, "notify", "0")
        weechat.buffer_set(rooms_buffer, "nicklist", "0")
        weechat.buffer_set(rooms_buffer, "type", "free")
        weechat.buffer_set(rooms_buffer, "key_bind_ctrl-L", "/hipchat rooms **refresh")
        weechat.buffer_set(rooms_buffer, "key_bind_meta2-A", "/hipchat rooms **up")
        weechat.buffer_set(rooms_buffer, "key_bind_meta2-B", "/hipchat rooms **down")
        weechat.buffer_set(rooms_buffer, "key_bind_meta2-1~", "/hipchat rooms **scroll_top")
        weechat.buffer_set(rooms_buffer, "key_bind_meta2-4~", "/hipchat rooms **scroll_bottom")
        weechat.buffer_set(rooms_buffer, "key_bind_meta-ctrl-J", "/hipchat rooms **enter")
        weechat.buffer_set(rooms_buffer, "key_bind_meta-ctrl-M", "/hipchat rooms **enter")
        weechat.buffer_set(rooms_buffer, "key_bind_meta->", "/hipchat rooms **sort_next")
        weechat.buffer_set(rooms_buffer, "key_bind_meta-<", "/hipchat rooms **sort_previous")
        weechat.buffer_set(rooms_buffer, "key_bind_meta-/", "/hipchat rooms **sort_invert")
        weechat.buffer_set(rooms_buffer, "localvar_set_bitlbee_server", bitlbee_server)
        rooms_curline = 0
    if weechat.config_get_plugin("autofocus") == "on":
        if not weechat.window_search_with_buffer(rooms_buffer):
            weechat.command("", "/buffer " + weechat.buffer_get_string(rooms_buffer, "name"))
示例#2
0
def lb_create_buffer():
  global lb_buffer, lb_curline

  if not lb_buffer:
    lb_buffer = weechat.buffer_new("listbuffer", "lb_input_cb", \
                "", "lb_close_cb", "")
    weechat.buffer_set(lb_buffer, "title", lb_line_format({
      'channel': 'Channel name',
      'users': 'Users',
      'modes': 'Modes',
      'topic': 'Topic',
      'nomodes': None,
    }))
    # Sets notify to 0 as this buffer does not need to be in hotlist.
    weechat.buffer_set(lb_buffer, "notify", "0")
    weechat.buffer_set(lb_buffer, "nicklist", "0")
    weechat.buffer_set(lb_buffer, "type", "free")
    weechat.buffer_set(lb_buffer, "key_bind_ctrl-L", "/listbuffer **refresh")
    weechat.buffer_set(lb_buffer, "key_bind_meta2-A", "/listbuffer **up")
    weechat.buffer_set(lb_buffer, "key_bind_meta2-B", "/listbuffer **down")
    weechat.buffer_set(lb_buffer, "key_bind_meta2-1~", "/listbuffer **scroll_top")
    weechat.buffer_set(lb_buffer, "key_bind_meta2-4~", "/listbuffer **scroll_bottom")
    weechat.buffer_set(lb_buffer, "key_bind_meta-ctrl-J", "/listbuffer **enter")
    weechat.buffer_set(lb_buffer, "key_bind_meta-ctrl-M", "/listbuffer **enter")
    weechat.buffer_set(lb_buffer, "key_bind_meta->", "/listbuffer **sort_next")
    weechat.buffer_set(lb_buffer, "key_bind_meta-<", "/listbuffer **sort_previous")
    weechat.buffer_set(lb_buffer, "key_bind_meta-/", "/listbuffer **sort_invert")
    lb_curline = 0
  if weechat.config_get_plugin("autofocus") == "on":
    if not weechat.window_search_with_buffer(lb_buffer):
      weechat.command("", "/buffer " + weechat.buffer_get_string(lb_buffer,"name"))
示例#3
0
def lb_create_buffer():
    global lb_buffer, lb_curline

    if not lb_buffer:
        lb_buffer = weechat.buffer_new("listbuffer", "lb_input_cb", \
                    "", "lb_close_cb", "")
        lb_set_buffer_title()
        # Sets notify to 0 as this buffer does not need to be in hotlist.
        weechat.buffer_set(lb_buffer, "notify", "0")
        weechat.buffer_set(lb_buffer, "nicklist", "0")
        weechat.buffer_set(lb_buffer, "type", "free")
        weechat.buffer_set(lb_buffer, "key_bind_ctrl-L",
                           "/listbuffer **refresh")
        weechat.buffer_set(lb_buffer, "key_bind_meta2-A", "/listbuffer **up")
        weechat.buffer_set(lb_buffer, "key_bind_meta2-B", "/listbuffer **down")
        weechat.buffer_set(lb_buffer, "key_bind_meta2-1~",
                           "/listbuffer **scroll_top")
        weechat.buffer_set(lb_buffer, "key_bind_meta2-4~",
                           "/listbuffer **scroll_bottom")
        weechat.buffer_set(lb_buffer, "key_bind_meta-ctrl-J",
                           "/listbuffer **enter")
        weechat.buffer_set(lb_buffer, "key_bind_meta-ctrl-M",
                           "/listbuffer **enter")
        weechat.buffer_set(lb_buffer, "key_bind_meta->",
                           "/listbuffer **sort_next")
        weechat.buffer_set(lb_buffer, "key_bind_meta-<",
                           "/listbuffer **sort_previous")
        weechat.buffer_set(lb_buffer, "key_bind_meta-/",
                           "/listbuffer **sort_invert")
        lb_curline = 0
    if weechat.config_get_plugin("autofocus") == "on":
        if not weechat.window_search_with_buffer(lb_buffer):
            weechat.command(
                "", "/buffer " + weechat.buffer_get_string(lb_buffer, "name"))
示例#4
0
def osc_notify_hook(udata, buf, date, tags, displayed, highlight, prefix,
                    message):
    if displayed and (highlight or 'notify_private' in tags.split(',')):
        is_visible = weechat.window_search_with_buffer(
            buf) == weechat.current_window()
        send_osc('im-notify', int(is_visible), int(is_tmux_visible()), prefix)

    return weechat.WEECHAT_RC_OK
def cs_get_buffer():
  global cs_buffer

  if not cs_buffer:
    # Sets notify to 0 as this buffer does not need to be in hotlist.
    cs_buffer = weechat.buffer_new("clone_scanner", "", \
                "", SCRIPT_CLOSE_CB, "")
    weechat.buffer_set(cs_buffer, "title", "Clone Scanner")
    weechat.buffer_set(cs_buffer, "notify", "0")
    weechat.buffer_set(cs_buffer, "nicklist", "0")
    if weechat.config_get_plugin("autofocus") == "on":
      if not weechat.window_search_with_buffer(cs_buffer):
        weechat.command("", "/buffer " + weechat.buffer_get_string(cs_buffer,"name"))

  return cs_buffer
示例#6
0
def cs_get_buffer():
    global cs_buffer

    if not cs_buffer:
        # Sets notify to 0 as this buffer does not need to be in hotlist.
        cs_buffer = weechat.buffer_new("clone_scanner", "", \
                    "", SCRIPT_CLOSE_CB, "")
        weechat.buffer_set(cs_buffer, "title", "Clone Scanner")
        weechat.buffer_set(cs_buffer, "notify", "0")
        weechat.buffer_set(cs_buffer, "nicklist", "0")
        if weechat.config_get_plugin("autofocus") == "on":
            if not weechat.window_search_with_buffer(cs_buffer):
                weechat.command(
                    "",
                    "/buffer " + weechat.buffer_get_string(cs_buffer, "name"))

    return cs_buffer
def create_script_buffer():
    global curline, script_buff

    if not script_buffer():
        script_buff = weechat.buffer_new(SCRIPT_BUFFERNAME, "buffer_input_cb", \
                    "", "buffer_close_cb", "")
        # Sets notify to 0 as this buffer does not need to be in hotlist.
        weechat.buffer_set(script_buffer(), "notify", "0")
        weechat.buffer_set(script_buffer(), "nicklist", "0")
        weechat.buffer_set(script_buffer(), "type", "free")
        weechat.buffer_set(script_buffer(), "key_bind_ctrl-L",
                           "/%s **refresh" % SCRIPT_COMMAND)
        weechat.buffer_set(script_buffer(), "key_bind_meta2-A",
                           "/%s **up" % SCRIPT_COMMAND)
        weechat.buffer_set(script_buffer(), "key_bind_meta2-B",
                           "/%s **down" % SCRIPT_COMMAND)
        weechat.buffer_set(script_buffer(), "key_bind_meta2-1~",
                           "/%s **scroll_top" % SCRIPT_COMMAND)
        weechat.buffer_set(script_buffer(), "key_bind_meta2-4~",
                           "/%s **scroll_bottom" % SCRIPT_COMMAND)
        weechat.buffer_set(script_buffer(), "key_bind_meta-ctrl-J",
                           "/%s **enter" % SCRIPT_COMMAND)
        weechat.buffer_set(script_buffer(), "key_bind_meta-ctrl-M",
                           "/%s **enter" % SCRIPT_COMMAND)
        weechat.buffer_set(script_buffer(), "key_bind_meta--",
                           "/%s **remove" % SCRIPT_COMMAND)
        weechat.buffer_set(script_buffer(), "key_bind_meta-+",
                           "/%s **add" % SCRIPT_COMMAND)
        weechat.buffer_set(script_buffer(), "key_bind_-",
                           "/%s **list" % SCRIPT_COMMAND)
        weechat.buffer_set(script_buffer(), "key_bind_+",
                           "/%s **colours" % SCRIPT_COMMAND)
        curline = 0
    if weechat.config_get_plugin("autofocus") == "on":
        if not weechat.window_search_with_buffer(script_buffer()):
            weechat.command(
                "", "/buffer " +
                weechat.buffer_get_string(script_buffer(), "name"))
示例#8
0
def create_script_buffer():
    global curline, script_buff

    if not script_buffer():
        script_buff = weechat.buffer_new(SCRIPT_BUFFERNAME, "buffer_input_cb", "", "buffer_close_cb", "")
        # Sets notify to 0 as this buffer does not need to be in hotlist.
        weechat.buffer_set(script_buffer(), "notify", "0")
        weechat.buffer_set(script_buffer(), "nicklist", "0")
        weechat.buffer_set(script_buffer(), "type", "free")
        weechat.buffer_set(script_buffer(), "key_bind_ctrl-L", "/%s **refresh" % SCRIPT_COMMAND)
        weechat.buffer_set(script_buffer(), "key_bind_meta2-A", "/%s **up" % SCRIPT_COMMAND)
        weechat.buffer_set(script_buffer(), "key_bind_meta2-B", "/%s **down" % SCRIPT_COMMAND)
        weechat.buffer_set(script_buffer(), "key_bind_meta2-1~", "/%s **scroll_top" % SCRIPT_COMMAND)
        weechat.buffer_set(script_buffer(), "key_bind_meta2-4~", "/%s **scroll_bottom" % SCRIPT_COMMAND)
        weechat.buffer_set(script_buffer(), "key_bind_meta-ctrl-J", "/%s **enter" % SCRIPT_COMMAND)
        weechat.buffer_set(script_buffer(), "key_bind_meta-ctrl-M", "/%s **enter" % SCRIPT_COMMAND)
        weechat.buffer_set(script_buffer(), "key_bind_meta--", "/%s **remove" % SCRIPT_COMMAND)
        weechat.buffer_set(script_buffer(), "key_bind_meta-+", "/%s **add" % SCRIPT_COMMAND)
        weechat.buffer_set(script_buffer(), "key_bind_-", "/%s **list" % SCRIPT_COMMAND)
        weechat.buffer_set(script_buffer(), "key_bind_+", "/%s **colours" % SCRIPT_COMMAND)
        curline = 0
    if weechat.config_get_plugin("autofocus") == "on":
        if not weechat.window_search_with_buffer(script_buffer()):
            weechat.command("", "/buffer " + weechat.buffer_get_string(script_buffer(), "name"))
示例#9
0
def osc_notify_hook(udata, buf, date, tags, displayed, highlight, prefix, message):
    if displayed and (highlight or 'notify_private' in tags.split(',')):
        is_visible = weechat.window_search_with_buffer(buf) == weechat.current_window()
        send_osc('im-notify', int(is_visible), int(is_tmux_visible()), prefix)

    return weechat.WEECHAT_RC_OK