#!/bin/sh cleanup() { echo "Ctrl+C pressed. Killing Xquartz..." pkill Xquartz exit 0 } trap cleanup INT open -a "Xquartz" while ! xdpyinfo -display "$DISPLAY"; do sleep 0.1 done xfreerdp /u:$USER /p:$PASSWORD /v:$IP /auto-reconnect-max-retries:0 /size:1920x900 +clipboard echo "Killing Xquartz" pkill Xquartz exit 0