i3 fix, other improvements
[distro-setup] / i3-konsole
index 74fd2c29f2d0bd52fd26b91e26db70650461db91..92afe30ef25f9be91af00f2da8c913c7a98d120a 100755 (executable)
@@ -26,18 +26,7 @@ set -eE -o pipefail
 trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" exit status: $?, PIPESTATUS: ${PIPESTATUS[*]}" >&2' ERR
 
 
-if i3-msg -t get_tree | jq --stream -r 'select(.[1]|scalars!=null) | "\(.[0]|join(".")): \(.[1]|tojson)"'  | grep 'marks.0: "term"$' &>/dev/null; then
-  h=$(i3-msg -t get_tree | jq -r ".. | select(.focused? == true) | .rect.height")
-
-  cur_workspace=$(i3-msg -t get_workspaces | jq -r '.[] | select(.focused? == true) | .name')
-
-  # h tests if we have a current focus, but that is just a random guess.
-  if [[ $cur_workspace == 2 && $h ]]; then
-    i3-msg "swap container with mark term; [con_mark=\"term\"] focus"
-  else
-    i3-msg "[con_mark=\"term\"] focus"
-  fi
-else
+if ! /a/c/i3-focus-maybe term; then
   i3-split-maybe
   konsole &
   sleep 1