From 6d5305234d96344cd6c9d6818f3a9571d1567fcd Mon Sep 17 00:00:00 2001 From: Robert Günzler Date: Tue, 7 Jul 2020 18:09:15 +0200 Subject: bin/swx: only autotile split-layout containers --- bin/swx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'bin') diff --git a/bin/swx b/bin/swx index 1536ad0..87a98d5 100755 --- a/bin/swx +++ b/bin/swx @@ -99,11 +99,15 @@ if [ -n "${rotate}" ]; then fi if [ -n "${autotile}" ]; then - if [ "$(swq current con | jq '.rect | .width > .height')" = "true" ]; then - swaymsg splith - else - swaymsg splitv - fi + case "$(swq current workspace | jq -r '.layout')" in + split*) + if [ "$(swq current con | jq '.rect | .width > .height')" = "true" ]; then + swaymsg splith + else + swaymsg splitv + fi + ;; + esac fi swaymsg exec "${command}" >/dev/null -- cgit 1.4.1