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"] move workspace current'
- fi
-else
+if ! /a/c/i3-focus-maybe term; then
i3-split-maybe
konsole &
sleep 1