Beispiel #1
0
def trees():
    tree_list = []

    with open(TREE_PATHS["first"], "r") as handle:
        tree_list.append(i3Tree(json.load(handle)))

    with open(TREE_PATHS["second"], "r") as handle:
        tree_list.append(i3Tree(json.load(handle)))

    return tree_list
Beispiel #2
0
def test_tree_created(json_tree):
    tree = i3Tree(json_tree)
    assert tree.raw_tree
    assert tree.root
    assert tree.root.children
    assert tree.root.children_dict
    assert tree.root.has_focus
    assert tree.root.focused_child
Beispiel #3
0
def main():
    """
    Entry point
    """
    parser = ArgumentParser()
    parser.add_argument("direction",
                        choices=("up", "down", "left", "right", "next",
                                 "prev"),
                        help="Direction to put the focus on")
    args = parser.parse_args()

    tree = i3Tree()
    con = None

    if args.direction in ("next", "prev"):
        con = cycle_outputs(tree, args.direction)
    else:
        con = cycle_windows(tree, args.direction)

    if con:
        i3.focus(con_id=con.id)
Beispiel #4
0
def main():
    """
    Entry point
    """
    parser = ArgumentParser()
    parser.add_argument("direction",
                        choices=(
                            "up", "down", "left", "right",
                            "next", "prev"
                        ),
                        help="Direction to put the focus on")
    args = parser.parse_args()

    tree = i3Tree()
    con = None

    if args.direction in ("next", "prev"):
        con = cycle_outputs(tree, args.direction)
    else:
        con = cycle_windows(tree, args.direction)

    if con:
        i3.focus(con_id=con.id)
Beispiel #5
0
def tree(json_tree):
    return i3Tree(json_tree)