aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoseConseco <bartosz.styperek@gmail.com>2022-11-16 16:00:57 +0100
committerJoseConseco <bartosz.styperek@gmail.com>2022-11-16 16:00:57 +0100
commit2d397385db79f00e4217e0cdb830b4c133c38170 (patch)
tree414dd9c29a60854c602496b832c61bd37d5983dd
parentd1152795460857434e9ead6e82a1c91447efdd80 (diff)
downloadautotiling-2d397385db79f00e4217e0cdb830b4c133c38170.tar.gz
add move event, skip resize if factor == 1
-rw-r--r--autotiling/main.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/autotiling/main.py b/autotiling/main.py
index c14a6b7..87d0ee0 100644
--- a/autotiling/main.py
+++ b/autotiling/main.py
@@ -123,11 +123,11 @@ def switch_splitting(i3, e, debug, outputs, workspaces, depth_limit, splitwidth,
elif debug:
print("Error: Switch failed with err {}".format(result[0].error), file=sys.stderr, )
- if e.change == "new" and con.percent:
- if con.parent.layout == "splitv": # top / bottom
+ if e.change in ["new","move"] and con.percent:
+ if con.parent.layout == "splitv" and splitheight != 1.0: # top / bottom
# print(f"split top fac {splitheight*100}")
i3.command(f"resize set height {int(con.percent*splitheight*100)} ppt")
- else: # left / right
+ elif con.parent.layout == "splith" and splitwidth != 1.0: # top / bottom: # left / right
# print(f"split right fac {splitwidth*100} ")
i3.command(f"resize set width {int(con.percent*splitwidth*100)} ppt")
@@ -221,8 +221,8 @@ def main():
outputs=args.outputs,
workspaces=args.workspaces,
depth_limit=args.limit,
- splitwidth=args.splitwidth,
- splitheight=args.splitheight,
+ splitwidth=args.splitwidth,
+ splitheight=args.splitheight,
splitratio=args.splitratio
)
i3 = Connection()