Skip to content

Instantly share code, notes, and snippets.

@skorotkiewicz
Created January 22, 2026 02:53
Show Gist options
  • Select an option

  • Save skorotkiewicz/a7502524874ad00761f95257a21bfda0 to your computer and use it in GitHub Desktop.

Select an option

Save skorotkiewicz/a7502524874ad00761f95257a21bfda0 to your computer and use it in GitHub Desktop.
antigravity fix
#!/bin/bash
UNIT_NAME="antigravity-$(date +%s)"
APP_BIN="/usr/bin/antigravity"
TRIGGER="Extension host with pid"
echo "[*] Start as: $UNIT_NAME"
# Build the command with all arguments properly quoted
if [ $# -eq 0 ]; then
# No arguments provided
CMD="$APP_BIN"
else
# Arguments provided - pass them through
CMD="$APP_BIN $(printf '%q ' "$@")"
fi
systemd-run --user \
--scope \
--unit="$UNIT_NAME" \
--property=KillMode=control-group \
/bin/bash -c "exec prlimit --core=0 $CMD 2>&1 | systemd-cat --identifier=$UNIT_NAME" &
journalctl --user --identifier="$UNIT_NAME" --follow |
grep --line-buffered --max-count=1 "$TRIGGER" &&
systemctl --user kill --signal=SIGKILL "$UNIT_NAME.scope"
echo "[*] Remaining processes are killed."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment