distro specific fixes
[distro-setup] / i3-konsole
index c4b5182f04a89aabe6a06eeac4264783c26a9c40..c18e588ef59db4ae03da343e6abfcc09764ebcfb 100755 (executable)
@@ -26,20 +26,11 @@ 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"] move workspace current'
-  fi
-else
+if ! /a/c/i3-focus-maybe term; then
+  i3-msg "workspace 2"
   i3-split-maybe
-  konsole
+  konsole &
   sleep 1
   i3-msg "[workspace=__focused__ class=\"konsole\"] mark term"
+  wait
 fi