Sorry to hear that you're struggling. None of this is easy - so don't beat yourself up too much if you need to take a breather.
Like the others said - there's nothing you can do to change what your X does. You can only control your own actions. To me it sounds like you're doing a great job of that, especially with your kids.
I know it's difficult but keep working at detachment. Got any projects or ventures coming up? Things that will benefit you and your future?
Hang in there man. You're a great dad. You know the truth - that's all that matters. Keep being the light.