def resize_single_window(keybind, geometries): """ Moves and resize the active window to one of the given geometries. The geometry is chosen via the used shortcut (keybind). :param keybind: The shortcut with which this method was called. :type keybind: :param geometries: :type geometries: list[dict] """ window = WindowTools.get_active_window() if WindowHandler.resize_old_keybind == keybind: WindowHandler.geometry_to_use_index = (WindowHandler.geometry_to_use_index + 1) % len(geometries) else: WindowHandler.resize_old_keybind = keybind WindowHandler.geometry_to_use_index = 0 #geometry consists of the position X, position Y, width, height geometry_numeric = GeometryParser.parse_geometry(geometries[WindowHandler.geometry_to_use_index]) print geometry_numeric geometry = map(int, geometry_numeric) window.move_and_resize(*geometry)