User Tools

Site Tools


uzbltreetab

tree based tab manager for uzbl written in c++.

http://github.com/jakeprobst/uzblstuff

example bindings (what I use)

@bind   tn    = sh 'echo "new" > \@tabfifo'
@bind   tcn   = sh 'echo "cnew" > \@tabfifo'
@bind   tp    = sh 'echo "new `xclip -selection clipboard -o`" > \@tabfifo'
@bind   tcp   = sh 'echo "cnew `xclip -selection clipboard -o`" > \@tabfifo'
@bind   tx    = sh 'echo "close \@NAME" > \@tabfifo'
@bind   ttx   = sh 'echo "treeclose \@NAME" > \@tabfifo'
@bind   .     = sh 'echo "next" > \@tabfifo'
@bind   ,     = sh 'echo "prev" > \@tabfifo'
@bind   tg _  = sh 'echo "new %s" > \@tabfifo'
@bind   tcg _ = sh 'echo "cnew %s" > \@tabfifo'
@bind   t _   = sh 'echo "goto %s" > \@tabfifo'
@bind   tf    = sh 'echo "first" > \@tabfifo'
@bind   tl    = sh 'echo "last" > \@tabfifo'
@bind   thl   = sh 'echo "hidetree" > \@tabfifo'
@bind   tsl   = sh 'echo "showtree" > \@tabfifo'
@bind   tmv _ = sh 'echo "move %s" > \@tabfifo'
@bind   ta _  = sh 'echo "attach %s" > \@tabfifo'
@on_event NEW_WINDOW sh 'echo "cnew %s" > \@tabfifo'

default event manager plugin:

 
def fifotab(uzbl, keylet):
    uzbl.fifopath = keylet
 
def tabs(uzbl, keylet):
    try:
        f = file(uzbl.fifopath, "wb")
        str = ("tabtitle %s %s\n" % (uzbl.name, keylet)).encode('utf8')
        f.write(str)
        f.close()
    except: pass
 
def turi(uzbl, keylet):
    try:
        f = file(uzbl.fifopath, "wb")
        str = ("taburi %s %s\n" % (uzbl.name, keylet)).encode('utf8')
        f.write(str)
        f.close()
    except: pass
 
def instancename(uzbl, keylet):
    uzbl.name = keylet
 
def init(uzbl):
    print dir(uzbl)
    for i in dir(uzbl):
        try:
            print i + ":", uzbl.__dict__[i]
        except:
            print i + ":", "nope"
    connects = {"TITLE_CHANGED": tabs,
                "LOAD_COMMIT": turi,
                "FIFOTAB": fifotab,
                "INSTANCE_NAME": instancename}
 
    uzbl.connect_dict(connects)
    uzbl.send("event INSTANCE_NAME @NAME")

note the custom uzbl-browser included, it does some necessary setup stuff.

uzbltreetab.txt · Last modified: 2016/08/31 14:10 (external edit)