def destroy_tmp(tmp_id): """Kill the window with the given id. We only use it to kill the tmp window. """ i3.kill(con_id=tmp_id)
def run(num): # current workspace current = [ws for ws in i3.get_workspaces() if ws['focused']][0] # switch to workspace named 'fibonacci' i3.workspace('fibonacci') i3.layout('default') fibonacci(num) time.sleep(3) # close all opened terminals for n in range(num): i3.kill() time.sleep(0.5) i3.workspace(current['name'])
def cycle(): # get currently focused windows current = i3.filter(nodes=[], focused=True) # get unfocused windows other = i3.filter(nodes=[], focused=False) # focus each previously unfocused window for 0.5 seconds for window in other: i3.focus(con_id=window['id']) i3.kill() # focus the original windows for window in current: i3.focus(con_id=window['id']) i3.kill()
def run(num): # current workspace current = [ws for ws in i3.get_workspaces() if ws["focused"]][0] # switch to workspace named 'fibonacci' i3.workspace("fibonacci") i3.layout("default") fibonacci(num) time.sleep(3) # close all opened terminals for n in range(num): i3.kill() time.sleep(0.5) i3.workspace(current["name"])
def destroy_tmp(tmp_id): i3.kill(con_id=tmp_id)
def kill(window): '''Kill the given window.''' return i3.kill(id=window)