#!/bin/bash

# Create a Tilix layout file in JSON format
layout_file=$(mktemp)
cat <<EOL > $layout_file
{
  "type": "Window",
  "tabs": [
    {
      "type": "Terminal",
      "children": [
        {
          "type": "Terminal",
          "children": [
            {
              "type": "Terminal",
              "command": "bash -c 'cd ~/PycharmProjects/UR_Robotiq && . install/setup.bash; exec bash'"
            },
            {
              "type": "Terminal",
              "command": "bash -c 'cd ~/PycharmProjects/UR_Robotiq && . install/setup.bash; exec bash'"
            }
          ],
          "orientation": "vertical"
        },
        {
          "type": "Terminal",
          "children": [
            {
              "type": "Terminal",
              "command": "bash -c 'cd ~/PycharmProjects/UR_Robotiq && . install/setup.bash; exec bash'"
            },
            {
              "type": "Terminal",
              "command": "bash -c 'cd ~/PycharmProjects/UR_Robotiq && . install/setup.bash; exec bash'"
            }
          ],
          "orientation": "vertical"
        }
      ],
      "orientation": "horizontal"
    }
  ]
}
EOL

# Open Tilix with the specified layout
tilix --session $layout_file

# Remove the temporary layout file
rm $layout_file
