Skip to content

Instantly share code, notes, and snippets.

@peterkingsbury
Last active October 30, 2021 15:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peterkingsbury/3295953fe963483190eb34f08db6ac27 to your computer and use it in GitHub Desktop.
Save peterkingsbury/3295953fe963483190eb34f08db6ac27 to your computer and use it in GitHub Desktop.
Script to launch dual Godot IDEs for Client and Server project instances along with a CLI, and position them across multiple monitors
#!/bin/bash
# CC0
# Use `xdotool` to identify and locate the position of your editor windows, then plug those numbers into this script.
set -e
set -x
GODOT_3_3_2_STABLE="/path/to/Godot_v3.3.2-stable_x11.64"
GODOT="$GODOT_3_3_2_STABLE"
PROJECT_DIR="/path/to/parent/project/directory"
# Launch a Godot instance for Client in the ./Client subdir
cd "$PROJECT_DIR/Client"
$GODOT --editor --windowed &
# Launch a Godot instance for Server in the ./Server subdir
cd "$PROJECT_DIR/Server"
$GODOT --editor --windowed &
# Launch a terminator instance
terminator --working-directory "$PROJECT_DIR" --title=devcli &
# Wait a while since Godot takes a moment to be ready for input
sleep 5
# Reposition the window with 'Client' in the title
CLIENT=`xdotool search --onlyvisible --name Client`
xdotool windowmove "$CLIENT" 1920 0
xdotool windowsize "$CLIENT" 1920 1016
# Reposition the window with 'Server' in the title
SERVER=`xdotool search --onlyvisible --name Server`
xdotool windowmove "$SERVER" 3840 0
xdotool windowsize "$SERVER" 1400 1056
# Reposition terminator
TERMINATOR=`xdotool search --onlyvisible --name devcli`
xdotool windowmove "$TERMINATOR" 5250 0
xdotool windowsize "$TERMINATOR" 520 1056
xdotool windowmove "$TERMINATOR" 5250 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment