Consolidated X11 based code into the setroot function