aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorneodarz <neodarz@neodarz.net>2018-04-10 09:52:45 +0200
committerneodarz <neodarz@neodarz.net>2018-04-10 09:52:45 +0200
commit05d4e07a811686aaf36158a8848b2436b4a63a60 (patch)
treec629c38f4935fe9a2f9baadd7f23675ecd054f43 /scripts
parent99e92def6295c223bd01256a208f7fbfd8232679 (diff)
downloaddotfiles_ascii-05d4e07a811686aaf36158a8848b2436b4a63a60.tar.xz
dotfiles_ascii-05d4e07a811686aaf36158a8848b2436b4a63a60.zip
Add top and bottom workspace switch
Diffstat (limited to '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)