Commit 64198b20 authored by Maxime Bombar's avatar Maxime Bombar
Browse files

[i3] Slide workspaces on a torus.

parent 8f85d537
......@@ -86,10 +86,10 @@ def slide_workspace(i3, workspace, output, direction):
owmap = output_workspace_mapping(i3)
workspaces = owmap.get(output)
pos = workspaces.index(workspace)
if direction == "right" and pos != len(workspaces) - 1:
if direction == "right":
logger.debug(f"Slide workspace \"{workspace}\" to the right.")
nextworkspace = workspaces[pos + 1]
elif direction == "left" and pos != 0:
nextworkspace = workspaces[(pos + 1) % len(workspaces)]
elif direction == "left":
logger.debug(f"Slide workspace \"{workspace}\" to the left.")
nextworkspace = workspaces[pos - 1]
else:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment