Added ability to test if X is running. Updated long messages to be outputted as heredocs