Example #1
0
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"])
Example #2
0
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'])
Example #3
0
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'])
Example #4
0
def make(tasks):
    for task in tasks:
        if task[0] == "run":
            Process(
                target = subprocess.call, args = (tuple(task[1].split(" ")), )
            ).start()
            time.sleep(1)
        elif task[0] == "resize":
            resize(task[1])
        elif task[0] == "orientation":
            doOrientation(task[1])
        elif task[0] == "layout":
            i3.layout(task[1])    
        time.sleep(1)
Example #5
0
 def run(self, root=None):
     if self.command:
         command = self.command.format(container=self, root=root)
         i3exec(command, root=root, sleep=self.delay)
     elif self.run_in_term:
         self.run_in_term = self.run_in_term.format(container=self, root=root)
         command = 'i3-sensible-terminal -title {container.title} -e $SHELL -i -c "{container.run_in_term}"'.format(container=self, root=root)
         i3exec(command, root=root, sleep=self.delay)
     else:
         raise Exception("no command")
     self.layout and i3.layout(self.layout)
     self.split and i3.split(self.split)
Example #6
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')
Example #7
0
extra.sort(key=lambda n:n['name'])

print("left")
print([node['name'] for node in left])
print("right")
print([node['name'] for node in right])
print("extra")
print([node['name'] for node in extra])


for leaf in leaves:
    i3.focus(con_id=leaf['id'])
    i3.move('scratchpad')

i3.focus(con_id=workspace['id'])
i3.layout('splitv')
for leaf in left:
    revisualize(leaf, workspace['name'])

first_right = right.pop(0)
revisualize(first_right, workspace['name'])
i3.move('right')
i3.split('v')
i3.focus(con_id=first_right['id'])
for leaf in right:
    revisualize(leaf, workspace['name'])


for leaf in extra:
    revisualize(leaf, workspace['name'])
    i3.move('down')
Example #8
0
def main():
    success = i3.layout('tabbed')

    if success:
        print('Successfully changed layout of the current workspace.')
Example #9
0
            return choice(window_list)
            
    else:
        return None

if __name__ == '__main__':
    args = parser.parse_args()

    # prepare
    to_play = args.files
    max_play = args.n
    video_commands = shlex.split(MPLAYER_CMD)
    dev_null = os.open("/dev/null", os.O_WRONLY)

    i3.workspace('videowall')
    i3.layout('default')

    print "max is %d" % (max_play)
    playing_videos = []
    while len(to_play)>0:

        # start playing
        while len(playing_videos)<max_play and len(to_play)>0:
            video=to_play.pop()
            print "Going to play %s" % (video)
            cmd = list(video_commands)
            cmd.append(video)
            print "cmd=%s" % (cmd)

            i3.workspace('videowall')
            w = find_player_to_split(args.split)
Example #10
0
import i3
success = i3.layout('splitv')
if success:
    print('Successfully changed layout of the current workspace.')
Example #11
0
import i3
success = i3.layout('tabbed')

if success:
    print('Successfully changed layout of the current workspace.')
Example #12
0
#!/usr/bin/env python

import i3
success = i3.layout('splith')
if success:
    print('Successfully changed layout of the current workspace.')