aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xdotfiles/scripts/cycle-workspace-multiscreen.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/dotfiles/scripts/cycle-workspace-multiscreen.py b/dotfiles/scripts/cycle-workspace-multiscreen.py
index e5e70ef..d1da2d8 100755
--- a/dotfiles/scripts/cycle-workspace-multiscreen.py
+++ b/dotfiles/scripts/cycle-workspace-multiscreen.py
@@ -44,19 +44,31 @@ if sys.argv[1] == "bottom":
output_origin_y = output_origin['rect']['y']
output_origin_height = output_origin['rect']['height']
next_workspace_start = output_origin_y + output_origin_height
+ output_origin_x = output_origin['rect']['x']
for output in outputs:
- if next_workspace_start == output['rect']['y']:
+ output_end = output['rect']['x'] + output['rect']['width']
+ # FIXME: screen must have the same start x position and screen with not
+ # the same resolution can by buggy
+ if (next_workspace_start == output['rect']['y'] and
+ output['rect']['x'] <= output_origin_x <= output_end):
output_destination = output
+
if sys.argv[1] == "top":
output_origin_y = output_origin['rect']['y']
output_origin_height = output_origin['rect']['height']
next_workspace_start = output_origin_y - output_origin_height
+ output_origin_x = output_origin['rect']['x']
for output in outputs:
next_workspace_start=output_origin_y - output['rect']['height']
- if next_workspace_start == output['rect']['y']:
+ output_end = output['rect']['x'] + output['rect']['width']
+ # FIXME: screen must have the same start x position and screen with not
+ # the same resolution can by buggy
+ if (next_workspace_start == output['rect']['y'] and
+ output['rect']['x'] <= output_origin_x <= output_end):
output_destination = output
+
if (output_destination != workspace_origin):
# Move origin workspace to the correct screen
i3.command('move', 'workspace to output '+output_destination['name'])