moved X related code to x-setup script