The fact that your wife commented on the hug means she still cares. Yeah she wants a D. Yeah she's confused. But then... Things turn around. It isn't over until you decide it's over. You are more in control than you think.
Get a life for yourself. Realize that you will probably have shared custody. The more you are OK, and having fun, the better off you will be, and however slim your chances, the "better" you are, the better the shot to save your marriage.