aboutsummaryrefslogtreecommitdiff
path: root/scripts/.scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/.scripts')
-rwxr-xr-xscripts/.scripts/cycle-workspace_more_2.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/scripts/.scripts/cycle-workspace_more_2.py b/scripts/.scripts/cycle-workspace_more_2.py
index fd2b13d..e49b6df 100755
--- a/scripts/.scripts/cycle-workspace_more_2.py
+++ b/scripts/.scripts/cycle-workspace_more_2.py
@@ -10,6 +10,12 @@ import sys
# figure out what is on, and what is currently on your screen.
workspace_origin = list(filter(lambda s: s['focused'], i3.get_workspaces()))[0]
outputs = list(filter(lambda s: s['active'], i3.get_outputs()))
+output_origin = ""
+
+print(workspace_origin)
+for output in outputs:
+ if output['current_workspace'] == workspace_origin['name']:
+ output_origin = output
def rename(origin, destination):
if destination >= 1 and destination <= 10:
@@ -39,6 +45,23 @@ if sys.argv[1] == "left":
if next_workspace_start == output['rect']['x']:
workspace_destination = output
+if sys.argv[1] == "bottom":
+ workspace_origin_y = output_origin['rect']['y']
+ workspace_origin_height = output_origin['rect']['height']
+ next_workspace_start = workspace_origin_y + workspace_origin_height
+ for output in outputs:
+ if next_workspace_start == output['rect']['y']:
+ workspace_destination = output
+
+if sys.argv[1] == "top":
+ workspace_origin_y = output_origin['rect']['y']
+ workspace_origin_height = output_origin['rect']['height']
+ next_workspace_start = workspace_origin_y - workspace_origin_height
+ for output in outputs:
+ next_workspace_start=workspace_origin_y - output['rect']['height']
+ if next_workspace_start == output['rect']['y']:
+ workspace_destination = output
+
if (workspace_destination != workspace_origin):
# Because workspace name are fixed to screen, just rename workspace can change workspace to another screen.
# Get temprory workspace of the screen destination (10, 20 or 30)