From cf3ac9d0be7ab698c28605eaacc842716622193e Mon Sep 17 00:00:00 2001 From: cbreton Date: Mon, 20 Jan 2020 09:48:28 +0100 Subject: Fix up and down screen rotation --- dotfiles/scripts/cycle-workspace-multiscreen.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'dotfiles') 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']) -- cgit v1.2.1