diff options
| author | tmu <t.man.atl.2012@gmail.com> | 2023-08-02 12:07:55 -0700 |
|---|---|---|
| committer | tmu <t.man.atl.2012@gmail.com> | 2023-08-02 12:07:55 -0700 |
| commit | 05d72eabc9e1f0daefe26be6f7c54f83f58d5f15 (patch) | |
| tree | 229cbfa49468c011954242ca11b475b9d04cb362 /sway/otherwindow~ | |
| parent | c2235d1850722932b7fb9dcf5907bbcc040bb29c (diff) | |
update. mostly emacs
Diffstat (limited to 'sway/otherwindow~')
| -rwxr-xr-x | sway/otherwindow~ | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/sway/otherwindow~ b/sway/otherwindow~ deleted file mode 100755 index 0a82e72..0000000 --- a/sway/otherwindow~ +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/env python3 - -import sys -import json -import subprocess - -direction=bool(sys.argv[1] == 't' or sys.argv[1] == 'T') -swaymsg = subprocess.run(['swaymsg', '-t', 'get_tree'], stdout=subprocess.PIPE) -data = json.loads(swaymsg.stdout) -current = data["nodes"][1]["current_workspace"] - -for output in data["nodes"]: - if "current_workspace" in output: - for workspace in output["nodes"]: - if workspace["name"] == output["current_workspace"]: - #maybe gives all the visible ones in multi monitor mode? - roi = workspace - break - -#workspace = int(data["nodes"][1]["current_workspace"])-1 -#roi = data["nodes"][1]["nodes"][workspace] -#print(roi) -temp = roi -windows = list() - -def getNextWindow(): - if focus < len(windows) - 1: - return focus+1 - else: - return 0 - -def getPrevWindow(): - if focus > 0: - return focus-1 - else: - return len(windows)-1 - -def makelist(temp): - for nodes in "floating_nodes", "nodes": - for i in range(len(temp[nodes])): - # print(temp[nodes][i]["name"]) - # print() - if temp[nodes][i]["name"] is None: - makelist(temp[nodes][i]) - elif temp[nodes][i]["visible"]: - windows.append(temp[nodes][i]) - -def focused(temp_win): - for i in range(len(temp_win)): - if temp_win[i]["focused"] == True: - return i - -makelist(temp) -#print(windows) -# print(len(windows)) -focus = focused(windows) -if str(sys.argv[1]) == 't' or str(sys.argv[1]) == 'T': - print(windows[getNextWindow()]["id"]) -else: - print(windows[getPrevWindow()]["id"]) |
