I have a script that I normally launch using the following syntax:
ssh -Yq user@host "xterm -e \'. /home/user/bin/prog1 $arg1;prog2\'"