示例#1
0
def main():
    i3.workspace(str(first_free()))
    i3.layout('default')
    i3.exec(browser)
    time.sleep(1)   # give browser window time to spawn
    i3.exec(term)
    time.sleep(0.5) # give terminal window time to spawn
    i3.split('v')
    i3.layout('stacking')
    i3.focus('left')
    i3.split('v')
    i3.layout('stacking')
示例#2
0
def fibonacci(num):
    i3.exec(term)
    time.sleep(0.5)
    if num % 2 == 0:
        if num % 4 == 0:
            i3.focus('up')
        i3.split('h')
    else:
        if num % 4 == 1:
            i3.focus('left')
        i3.split('v')
    if num > 1:
        fibonacci(num - 1)
示例#3
0
def fibonacci(num):
    i3.exec(term)
    time.sleep(0.5)
    if num % 2 == 0:
        if num % 4 == 0:
            i3.focus('up')
        i3.split('h')
    else:
        if num % 4 == 1:
            i3.focus('left')
        i3.split('v')
    if num > 1:
        fibonacci(num - 1)
示例#4
0
def fibonacci(num):
    i3.exec(term)
    time.sleep(0.5)
    if num % 2 == 0:
        if num % 4 == 0:
            i3.focus("up")
        i3.split("h")
    else:
        if num % 4 == 1:
            i3.focus("left")
        i3.split("v")
    if num > 1:
        fibonacci(num - 1)
示例#5
0
def fibonacci(num):
    i3.exec(prog)
    i3.border('1pixel')
    time.sleep(0.5)
    if num % 2 == 0:
        i3.border('1pixel')
        if num % 4 == 0:
            i3.focus('up')
            i3.border('1pixel')
        i3.split('h')
        i3.border('1pixel')
    else:
        i3.border('1pixel')
        if num % 4 == 1:
            i3.focus('left')
        i3.split('v')
    if num > 1:
        fibonacci(num - 1)
示例#6
0
def fibonacci(num):
    i3.exec(prog)
    i3.border('none')
    i3.gaps('inner', 'all', 'set', '15')
    time.sleep(0.5)
    if num % 2 == 0:
        i3.border('none')
        if num % 4 == 0:
            i3.focus('up')
            i3.border('none')
        i3.split('h')
        i3.border('none')
    else:
        i3.border('none')
        if num % 4 == 1:
            i3.focus('left')
        i3.split('v')
    if num > 1:
        fibonacci(num - 1)
示例#7
0
barHeight = 18
tree = str(i3.get_tree());

def positionWindow():
    i3.scratchpad("show", instance="metask")
    workspace = [ws for ws in i3.get_workspaces() if ws['focused']][0]
    screen_w =str(workspace['rect']['width'])
    screen_h =str(workspace['rect']['height'])

    targetheight = str(workspace['rect']['height']/3)

    current = i3.filter(nodes=[], focused=True)

    i3.command("move","absolute","position","0",str(barHeight))
    i3.command("resize","shrink","width",screen_w);
    i3.command("resize","shrink","height",screen_h);
    i3.command("resize","grow","width",screen_w);
    i3.command("resize","grow","height",targetheight);


#look for an entity that has the unique name of a scratchpad
m = re.search("metask", tree)
#if not found, spawn a new one
if(m == None):
    i3.exec('urxvt -name metask')
    sleep(0.11)
    positionWindow();
else:
    positionWindow();
def run_command(command):
    i3.exec(command)